How can solve this issues? Error (Xcode): Framework not found Flutter
I tried to more methods,
tried to delete ios then pod install...
tried to flutter clean...
tried to create new project etc.
but still cannot solve.
Launching lib/main.dart on iPhone 13 Pro Max in debug mode...
/Users/pin-chientseng/Desktop/yomate/ios/Runner/Info.plist: Property List error: Found non-key inside <dict> at line 56 / JSON error:
JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0.
Xcode build done. 221.1s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/rg/v6d4v6m545949bhd3pv5555r0000gn/T/flutter_tools.hhxYin/flutter_ios_build_temp_dirsANWae/temporary_xcresult_bundle
ld: framework not found Flutter
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
warning: Stale file '/Users/pin-chientseng/Desktop/yomate/build/ios/Debug-iphonesimulator/Runner.app/GoogleService-Info.plist' is
located outside of the allowed root paths.
note: Removed stale file
'/Users/pin-chientseng/Library/Developer/Xcode/DerivedData/Runner-bfllcubjuppngacurzilkdnplylp/Build/Intermediates.noindex/Runner
.build/Debug-iphonesimulator/Runner.build/InputFileList-5F0225AF943341352A9BA345-Pods-Runner-resources-Debug-input-files-37e3c74e
61b246db180ac6f1b6f5519a-resolved.xcfilelist'
note: Removed stale file
'/Users/pin-chientseng/Library/Developer/Xcode/DerivedData/Runner-bfllcubjuppngacurzilkdnplylp/Build/Intermediates.noindex/Runner
.build/Debug-iphonesimulator/Runner.build/InputFileList-678E497CE5823DAA4909D0F3-Pods-Runner-frameworks-Debug-input-files-6f17fb4
132a6c963427e5fd8c0f46475-resolved.xcfilelist'
note: Removed stale file
'/Users/pin-chientseng/Library/Developer/Xcode/DerivedData/Runner-bfllcubjuppngacurzilkdnplylp/Build/Intermediates.noindex/Runner
.build/Debug-iphonesimulator/Runner.build/OutputFileList-5F0225AF943341352A9BA345-Pods-Runner-resources-Debug-output-files-2b94b0
84fd7edee03f689887bc427bd3-resolved.xcfilelist'
note: Removed stale file
'/Users/pin-chientseng/Library/Developer/Xcode/DerivedData/Runner-bfllcubjuppngacurzilkdnplylp/Build/Intermediates.noindex/Runner
.build/Debug-iphonesimulator/Runner.build/OutputFileList-678E497CE5823DAA4909D0F3-Pods-Runner-frameworks-Debug-output-files-3dbe4
531b144e8e556eea6741f7e46e6-resolved.xcfilelist'
note: Removed stale file
'/Users/pin-chientseng/Library/Developer/Xcode/DerivedData/Runner-bfllcubjuppngacurzilkdnplylp/Build/Intermediates.noindex/Runner
.build/Debug-iphonesimulator/Runner.build/Script-5F0225AF943341352A9BA345.sh'
note: Removed stale file
'/Users/pin-chientseng/Library/Developer/Xcode/DerivedData/Runner-bfllcubjuppngacurzilkdnplylp/Build/Intermediates.noindex/Runner
.build/Debug-iphonesimulator/Runner.build/Script-678E497CE5823DAA4909D0F3.sh'
note: Removed stale file
'/Users/pin-chientseng/Library/Developer/Xcode/DerivedData/Runner-bfllcubjuppngacurzilkdnplylp/Build/Intermediates.noindex/Runner
.build/Debug-iphonesimulator/Runner.build/Script-69D48C77EE5D169DAA62588C.sh'
/Users/pin-chientseng/Desktop/yomate/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target
'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target
'FMDB' from project 'Pods')
/Users/pin-chientseng/Desktop/yomate/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target
'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target
'leveldb-library' from project 'Pods')
Result bundle written to path:
/var/folders/rg/v6d4v6m545949bhd3pv5555r0000gn/T/flutter_tools.hhxYin/flutter_ios_build_temp_dirsANWae/temporary_xcresult_bundle
Error (Xcode): Framework not found Flutter
Could not build the application for the simulator.
Error launching application on iPhone 13 Pro Max.
if I used this methods,
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if Gem::Version.new('8.0') > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
end
end
end
end
i will got this error...
Launching lib/main.dart on iPhone 13 Pro Max in debug mode...
Running pod install... 38.2s
Running Xcode build...
Xcode build done. 28.7s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/rg/v6d4v6m545949bhd3pv5555r0000gn/T/flutter_tools.gk0YEl/flutter_ios_build_temp_dirWL743Q/temporary_xcresult_bundle
/Users/pin-chientseng/Development/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_avfoundation-2.3.4/ios/Classes/messages
.g.m:7:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
Result bundle written to path:
/var/folders/rg/v6d4v6m545949bhd3pv5555r0000gn/T/flutter_tools.gk0YEl/flutter_ios_build_temp_dirWL743Q/temporary_xcresult_bundle
Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Users/pin-chientseng/Development/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_avfoundation-2.3.4/ios/Classes/messages.g.m
:6:8
Could not build the application for the simulator.
Error launching application on iPhone 13 Pro Max.
I have tried many solutions for this error. The only possible solution is to delete the flutter folder in the FLUTTER PATH, and re-copy the flutter folder.
This solved my error.
In my case, I got this error after deleting the flutter instances while trying to clean up some storage on my 258go macbook to update Xcode :(, in doing so I probably deleted the flutter.framework.
The solutions given here have not changed anything for me.
So I tried to clean up everything in the pod, including the cache. The pod install command failed because it missed the ios tools, which can be downloaded with flutter precache --ios.
So the complete process to solve this problem for me was :
cd ios
pod cache clean --all
rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData/*
pod deintegrate
flutter precache --ios
pod install
I hope that this solution will help someone and prevent them from losing a whole day's work as it did for me.
1- flutter channel beta
2- flutter upgrade
3- flutter run
4- flutter channel stable
5- flutter upgrade
6- flutter run
Flutter version is 2.2.3 and I cant't run de flutter code on my iOS emulator.
Launching lib/main.dart on iPhone 13 Pro in debug mode...
lib/main.dart:1
Xcode build done. 43.6s
Failed to build iOS app
Error output from Xcode build:
↳
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
{ platform:iOS Simulator, id:320795B7-1385-4044-B442-87A9808936D9, OS:15.0, name:iPhone 13 Pro }
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:iOS, id:00008101-000825EC3AE1001E, name:leobidoous iPhone, error:Device is busy (Making leobidoous iPhone ready for development, Processing cache files from device, Making the device ready for development) }
** BUILD FAILED **
Xcode's output:
↳
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in parallel
I had the same problem updating Xcode. Solve just logging back into Xcode.
Open Xcode
Open the project's Runner.xcworkspace file
Log into Xcode at: "Signing & Capabilities" -> "All" -> "Signing"
Item 3 was my problem. When updating Xcode, I was logged out.
Adding these lines to Podfile Helped me.
target.build_configurations.each do |build_configuration|
build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386'
end
Example:
If you use package sign_in_with_apple, it should have 3.2.0 version at least.
put this code in your Podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |build_configuration|
build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386'
end
end
end
The only solution that worked for me was to completely remove the xcode installed and reinstall from the app store.
When removing the old xcode, make sure to remove all the residual files - especially the developer folder.
Try these following commands
sudo rm -rf ~/Library/Developer/
sudo rm -rf ~/Library/Caches/com.apple.dt.Xcode
and remove xcode from Application to bin. Doing this will completely clean the xcode residuals and then you can reinstall from the appstore.
I encountered same issue and by running flutter clean fixed the issue for me.
Also try restarting the IDE if this doesn't work.
For me, I am fine after forcing the Simulator.app quit and run the command again.
I faced the same issue for flutter version 2.5.1 stable
Previously i installed flutter using Zip archive file now I completely removed that installation and setup it using Git clone
I did things like flutter clean, pod clear cache , pod install etc
IMP Note in xcode please check developer signing&capabilities options for runner etc
I did these and these are worked for me
The relevant part here is
Command PhaseScriptExecution failed with a nonzero exit code
which means that any of the scripts configured in Xcode > Targets > Runner > (Tab) Build Phases failed. The problem here is that you do not see the error message (which script failed and why).
Add the --verbose flag (short: -v) to the flutter run command:
flutter run -v
This will output a lot. At the end you need to scroll a bit up to the the actual script error.
Once you know the actual error, you probably can solve it easily or open a new and more specific question.
I encountered the same error on flutter 2.5.3. Now I downgraded to 2.5.1 and the app is running on my iOS emulator. Try this may help you.
I have solved it by clean the IDEA + flutter clean then restarting Mac then open Xcode from flutter project then clean Xcode build by select product -> Celan Build folder then RUN your project from Xcode to download dependence
Add the below lines to your podfile. Place the below lines in the post_install do [installer] section at the bottom of the Podfile.
Code :
target.build_configurations.each do |build_configuration|
build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386'
end
All of the answers here, depending on your circumstances, have aspects that absolutely remove this error. For myself, what I can say is that I can confirm that using an 2021 M1 macbook pro max with a fresh set of tools, flutter 2.8.1, dart 1.15.1 and having the following or similar post_install section in my podfile also silenced the offending output.
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf'
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386'
end
end
end
Try this. This process will re-download ios and android development tools again after running the code through the ios and android simulator. Worked for me
Flutter clean
Flutter get
Flutter channel stable
flutter upgrade
and restart IDE as well as close Xcode. works for me, I hope this helps
If your project is with firebase and it is cloned and cleaning is not well like me. Probably this can help you.
Add GoogleService-Info.plist back to your Runner project. (if already have can ignore)
Try to Clean Build Folder on xcode then Build again.
Try to build into Simulator using xcode.
Try to build into your connected iPhone.
If 3 and 4 is working. Back to your vscode then build and run again to iPhone or Simulator
Running pod install... 1.6s
Running Xcode build...
Xcode build done. 7.6s
Failed to build iOS app
Error output from Xcode build:
↳
objc[9381]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1eb0e27a0) and ?? (0x1162f02b8). One of the two will be used. Which one is undefined.
objc[9381]: Class AMSupportURLSession is implemented in both ?? (0x1eb0e27f0) and ?? (0x1162f0308). One of the two will be used. Which one is undefined.
** BUILD FAILED **
Xcode's output:
↳
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the precompiled application for the device.
I have tried deleting the bin/cache folder as well, and it has not worked. Running on an M1 Mac.
In my case I solved the problem by removing a Firebase library I was using for the storage on the web.
It was conflicting with the iOS version for some reason.
I solved this using the following method:
Backup existing ios folder in your project
Create a new flutter app in you home directory.
flutter create my_app
Copy the ios folder from the newly created app into your existing project.
navigate to the project folder and run the app using flutter run
cd ~/myproject
flutter run
I am not sure why it worked, but it did. My guess is that I fouled up a config file or plist file somewhere.
I had the same problem. You may try the below:
Go to the project folder:
$ rm ios/Flutter/Flutter.podspec
$ flutter clean
Works for me.
The solution which worked for me. Sorry I didn't post earlier.
Go to your flutter project
Open your runner.xcodeproj folder
open the contents.xcworkspace file and you will have an option to open ios module on code
Run your code by pressing the play button
The build will fail so go to the error log. And the real error will be there. The AMSupportURLConnectionDelegate isn't the real reason your build is failing.
This error occurs because of the Xcode beta version.
If you are using Firebase Auth you may face this kind of issue, Change the X-code version as stable
change like this in your Podfile.
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
end
end
end
Open your iOS folder in your X-code and find the file like this FIRAUTH DEFAULT DELEGATE
#import <TargetConditionals.h>
#if !TARGET_OS_OSX && !TARGET_OS_WATCH
then close the Xcode and try flutter run
If it is not working you have to delete your pod files and then again do flutter run
For me this was firebase_crashlytics: ^0.2.3+1 causing the issue. Commenting out this allowed the build on simulator to run.
I installed Cocoapods. I used GoogleMaps. When I build workspace on my device i get this error: Error
I also tried all this instructions: Linker command failed with exit code 1 after installing CocoaPods and firebase pod
P.S. Building on simulator works
Probably you've already check if you've open the .xcworkspace created in your project folder.(NOT .xcodeproj)
If still doesn't work try
Go to Project Settings.
Go to Build Settings.
Change BUILD ACTIVE
ARCHITECTURE ONLY to NO.
I am getting this error while building the SwiftJSON framework to the Some Xcode project through Carthage Dependency Manager.
Sivaramaiahs-Mac-mini:GZipDemoApp vsoftMacmini5$ carthage update
--platform iOS
*** Fetching GzipSwift
*** Fetching SwiftyJSON
*** Checking out GzipSwift at "3.1.1"
*** Downloading SwiftyJSON.framework binary at "3.1.3"
*** xcodebuild output can be found in /var/folders/7m/y0r2mdhn0f16zz1nlt34ypzr0000gn/T/carthage-xcodebuild.apLXCc.log
A shell task (/usr/bin/xcrun xcodebuild -project
/Users/vsoftMacmini5/Desktop/GZipDemoApp/Carthage/Checkouts/GzipSwift/Gzip.xcodeproj
CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list)
failed with exit code 72:
xcrun: error: unable to find utility "xcodebuild", not a developer
tool or in PATH
I solved that problem by setting the Command Line Tools in Xcode. Go to:
Xcode > Preferences > Locations
And select the command line tool from the dropdown. If you have only one version of Xcode installed, there should be only one option. If you have several versions of Xcode, then you must choose the one you need.
Update (added image for reference)
The simplest fix is from CLI:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
(this should be path to your Xcode.app)
By the way this can happen even if you have only one version of Xcode . It happens when you instal homebrew before the first Xcode installation (which makes sense because you may want to install Xcode through mas install 497799835 and mas needs homebrew).
Following command worked for me
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer