I am dealing with a problem 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 difficulty persists. I am utilizing the most recent Flutter SDK, Xcode, and macOS variations. Any steerage to resolve this is able to be enormously appreciated
import Flutter
import UIKit
@foremost
@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'
undertaking '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__)
until File.exist?(generated_xcode_build_settings_path)
increase "#{generated_xcode_build_settings_path} should exist. In case you're working 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 problem is persisting whereas working [ +69 ms] Did not 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 appliance for the simulator.
[ ] Error launching software on iPhone 16 Professional Max.
[ +3 ms] "flutter run" took 173,509ms.
[ +56 ms]
#0 throwToolExit (bundle:flutter_tools/src/base/widespread.dart:10:3)
#1 RunCommand.runCommand (bundle:flutter_tools/src/instructions/run.dart:860:9)
<asynchronous suspension>
#2 FlutterCommand.run.<nameless closure> (bundle:flutter_tools/src/runner/flutter_command.dart:1450:27)
<asynchronous suspension>
#3 AppContext.run.<nameless closure> (bundle:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#4 CommandRunner.runCommand (bundle:args/command_runner.dart:212:13)
<asynchronous suspension>
#5 FlutterCommandRunner.runCommand.<nameless closure>
(bundle:flutter_tools/src/runner/flutter_command_runner.dart:421:9)
<asynchronous suspension>
#6 AppContext.run.<nameless closure> (bundle:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand (bundle:flutter_tools/src/runner/flutter_command_runner.dart:364:5)
<asynchronous suspension>
#8 run.<nameless closure>.<nameless closure> (bundle:flutter_tools/runner.dart:131:9)
<asynchronous suspension>
#9 AppContext.run.<nameless closure> (bundle:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#10 foremost (bundle:flutter_tools/executable.dart:94:3)
<asynchronous suspension> 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 difficulty persists. Initially, I managed to resolve it by working 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. Take into account 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; nevertheless it is strongly recommended 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/House/bin/java
• Java model OpenJDK Runtime Surroundings (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 net
• 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 will be put in from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin will be put in from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java model OpenJDK Runtime Surroundings (construct 17.0.11+0-17.0.11b1207.24-11852314)
[✓] IntelliJ IDEA Neighborhood Version (model 2023.1)
• IntelliJ at /Purposes/IntelliJ IDEA CE.app
• Flutter plugin will 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 machine (3 out there)
• iPhone 16 Professional Max (cellular) • 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 sources
• All anticipated community sources can be found.
This mounted the difficulty quickly. Nevertheless, 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 looking for steerage to resolve this persistent problem as soon as and for all. Any insights or solutions could be enormously appreciated!