I am dealing with a difficulty whereas constructing my Flutter app for the iOS simulator. The construct fails with the error:
vbnet
Copy
Edit
Error (Xcode): Framework ‘Flutter’ not discovered
Error (Xcode): Linker command failed with exit code 1
I’ve tried the next steps:
Recreated the ios/ folder and cleared derived knowledge.
Ran flutter clear, reinstalled CocoaPods (pod deintegrate and pod set up).
Verified AppDelegate and framework paths in Xcode.
Ensured the deployment goal is ready to 14.0 within the Podfile.
Regardless of these efforts, the problem persists. I am utilizing the most recent Flutter SDK, Xcode, and macOS variations. Any steering to resolve this could be significantly appreciated
import Flutter
import UIKit
@important
@objc class AppDelegate: FlutterAppDelegate {
override func software(
_ software: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return tremendous.software(software, didFinishLaunchingWithOptions: launchOptions)
}
}
and my podfile platform :ios, '14.0'
# CocoaPods analytics sends community stats synchronously affecting flutter construct latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
challenge 'Runner', {
'Debug' => :debug,
'Profile' => :launch,
'Launch' => :launch,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.be a part of('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
except File.exist?(generated_xcode_build_settings_path)
increase "#{generated_xcode_build_settings_path} should exist. If you happen to're operating pod set up manually, be sure flutter pub get is executed first"
finish
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT=(.*)/)
return matches[1].strip if matches
finish
increase "FLUTTER_ROOT not present in #{generated_xcode_build_settings_path}. Strive deleting Generated.xcconfig, then run flutter pub get"
finish
require File.expand_path(File.be a part of('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
goal 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
goal 'RunnerTests' do
inherit! :search_paths
finish
finish
post_install do |installer|
installer.pods_project.targets.every do |goal|
flutter_additional_ios_build_settings(goal)
goal.build_configurations.every do |config|
xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.learn(xcconfig_path)
xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
finish
finish
finish and this situation is persisting whereas operating [ +69 ms] Didn't construct iOS app
[ +14 ms] Error (Xcode): Framework 'Flutter' not discovered
[ +2 ms] Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)
[ +3 ms] Couldn't construct the applying for the simulator.
[ ] Error launching software on iPhone 16 Professional Max.
[ +3 ms] "flutter run" took 173,509ms.
[ +56 ms]
#0 throwToolExit (package deal:flutter_tools/src/base/widespread.dart:10:3)
#1 RunCommand.runCommand (package deal:flutter_tools/src/instructions/run.dart:860:9)
#2 FlutterCommand.run. (package deal:flutter_tools/src/runner/flutter_command.dart:1450:27)
#3 AppContext.run. (package deal:flutter_tools/src/base/context.dart:153:19)
#4 CommandRunner.runCommand (package deal:args/command_runner.dart:212:13)
#5 FlutterCommandRunner.runCommand.
(package deal:flutter_tools/src/runner/flutter_command_runner.dart:421:9)
#6 AppContext.run. (package deal:flutter_tools/src/base/context.dart:153:19)
#7 FlutterCommandRunner.runCommand (package deal:flutter_tools/src/runner/flutter_command_runner.dart:364:5)
#8 run.. (package deal:flutter_tools/runner.dart:131:9)
#9 AppContext.run. (package deal:flutter_tools/src/base/context.dart:153:19)
#10 important (package deal:flutter_tools/executable.dart:94:3)
Carried out flutter clear, eliminated and reinstalled Pods (pod deintegrate, pod set up).
Deleted derived knowledge utilizing rm -rf ~/Library/Developer/Xcode/DerivedData.
Recreated the ios/ folder.
Up to date CocoaPods and ensured all dependencies in pubspec.yaml are up-to-date.
Verified AppDelegate.swift and ensured Firebase setup (added FirebaseCore initialization in AppDelegate.swift).
Regardless of these efforts, the problem persists. Initially, I managed to resolve it by operating these steps in sequence:
bash
Copy
Edit
flutter clear
rm -rf ios/Pods
rm -rf ios/.symlinks
rm -rf ios/Flutter/Flutter.framework
sudo gem set up cocoapods
pod repo replace
cd ios
pod set up
flutter improve
flutter pub get
cd ios
pod deintegrate
pod set up
rm -rf ~/Library/Developer/Xcode/DerivedData
flutter clear
flutter pub get
cd ios
pod set up
cd ..
flutter run
and Flutter (Channel steady, 3.27.3, on macOS 15.2 24C101 darwin-arm64, locale en-US)
• Flutter model 3.27.3 on channel steady at /Customers/rao/Flutter/flutter
! Warning: `dart` in your path resolves to /choose/homebrew/Cellar/dart/2.19.6/libexec/bin/dart, which isn't inside your present Flutter SDK checkout at
/Customers/rao/Flutter/flutter. Contemplate including /Customers/rao/Flutter/flutter/bin to the entrance of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c519ee916e (22 hours in the past), 2025-01-21 10:32:23 -0800
• Engine revision e672b006cb
• Dart model 3.6.1
• DevTools model 2.40.2
• If these had been intentional, you may disregard the above warnings; nonetheless it's endorsed to make use of "git" on to carry out replace checks and upgrades.
[✓] Android toolchain - develop for Android gadgets (Android SDK model 33.0.2)
• Android SDK at /Customers/rao/Library/Android/sdk
• Platform android-34, build-tools 33.0.2
• Java binary at: /Purposes/Android Studio.app/Contents/jbr/Contents/Residence/bin/java
• Java model OpenJDK Runtime Setting (construct 17.0.11+0-17.0.11b1207.24-11852314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
• Xcode at /Purposes/Xcode.app/Contents/Developer
• Construct 16C5032a
• CocoaPods model 1.16.2
[✓] Chrome - develop for the online
• Chrome at /Purposes/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (model 2024.1)
• Android Studio at /Purposes/Android Studio.app/Contents
• Flutter plugin could be put in from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin could be put in from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java model OpenJDK Runtime Setting (construct 17.0.11+0-17.0.11b1207.24-11852314)
[✓] IntelliJ IDEA Group Version (model 2023.1)
• IntelliJ at /Purposes/IntelliJ IDEA CE.app
• Flutter plugin could be put in from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin model 231.8109.91
[✓] VS Code (model 1.96.4)
• VS Code at /Purposes/Visible Studio Code.app/Contents
• Flutter extension model 3.102.0
[✓] Linked system (3 accessible)
• iPhone 16 Professional Max (cell) • A7B39C80-26F4-4271-A9E7-721D5075061C • ios • com.apple.CoreSimulator.SimRuntime.iOS-18-2 (simulator)
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 15.2 24C101 darwin-arm64
• Chrome (internet) • chrome • web-javascript • Google Chrome 132.0.6834.83
[✓] Community assets
• All anticipated community assets can be found.
This fastened the problem quickly. Nonetheless, after two days, I confronted errors in Firebase telephone authentication. I added FirebaseCore initialization in AppDelegate.swift, which resolved the Firebase error however reintroduced the "Framework 'Flutter' not discovered" error.
I’m searching for steering to resolve this persistent situation as soon as and for all. Any insights or recommendations can be significantly appreciated!