Flutter project run on the ios13 - ios

I just update my system to the latest MacOS 10.15 , and Xcode update to 11 , my iPhone XR just update to the iOS 13.1 . I run my flutter project, then get error here
the log
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: Multiple commands produce '/Users/eriklu/development/codes/flutter/study/flutter_trip/demo/flutter_base_demo/build/ios/Debug-iphoneos/Runner.app/Frameworks/Flutter.framework':
1) Target 'Runner' has copy command from '/Users/eriklu/development/codes/flutter/study/flutter_trip/demo/flutter_base_demo/ios/Flutter/Flutter.framework' to '/Users/eriklu/development/codes/flutter/study/flutter_trip/demo/flutter_base_demo/build/ios/Debug-iphoneos/Runner.app/Frameworks/Flutter.framework'
2) That command depends on command in Target 'Runner': script phase “[CP] Embed Pods Frameworks”
note: Using new build systemnote: Planning buildnote: Constructing build descriptionwarning: duplicate output file '/Users/eriklu/development/codes/flutter/study/flutter_trip/demo/flutter_base_demo/build/ios/Debug-iphoneos/Runner.app/Frameworks/Flutter.framework' on task: PhaseScriptExecution [CP] Embed Pods Frameworks /Users/eriklu/Library/Developer/Xcode/DerivedData/Runner-cguezvpzlkcjmwafakhebgbckazf/Build/Intermediates.noindex/Runner.build/Debug-iphoneos/Runner.build/Script-73506C6A4A6DF54A6CA02CB5.sh (in target 'Runner' from project 'Runner')
Could not build the precompiled application for the device.
Error launching application on 路过的程序猿.

Try opening Xcode and go to the Runner's settings and open the Build Phases tab.
Go to Embed Frameworks, you should definitely see Flutter.framework and App.Framework
Xcode screenshot
Check that actually during the update Xcode has not damaged the files in the Framework, you can usually see it by looking at the icon, but you can also use the right button and see it in the Finder.
If you should see the disabled icon or could not open it in the Finder the solution is quite simple, you just need to create a new application in Flutter and replace the Framework folders (for iOS) that are in
yourAppName / ios / Flutter /

Related

device_info_plus.framework: No such file or directory (in target 'Runner' from project 'Runner')

when I build the flutter 2.10.3 app in android studio, shows error like this:
Xcode's output:
↳
Writing result bundle at path:
/var/folders/1p/dz3r2rz55kd60_t8sgslkvvh0000gn/T/flutter_tools.EA7MO2/flutter_ios_build_temp_dir8UFRrl/temporary_xcresult_bundle
error: /Users/xiaoqiangjiang/source/reddwarf/frontend/cruise-open/build/ios/Debug-iphonesimulator/device_info_plus.framework: No such file or directory (in target 'Runner' from project 'Runner')
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
Result bundle written to path:
/var/folders/1p/dz3r2rz55kd60_t8sgslkvvh0000gn/T/flutter_tools.EA7MO2/flutter_ios_build_temp_dir8UFRrl/temporary_xcresult_bundle
I have added the device_info_plus in xcode 13.4.1, why still show this error?
I check my project and found that the device info plus was org.cocoapods.device-info-plus, version 0.0.1.

flutter build ios --release fatal error: module 'add_2_calendar' not found

I want to make a release for my project who work perefctly in dev mode.
When I make only flutter ios build it works fine
but flutter build ios --release doesn't work
the error message
youssefdahar#MacBook-Pro-van-Youssef devs % flutter build ios --release
Building com.example.mental for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: X6BX32XBYP
Running pod install... 1 022ms
Running Xcode build...
└─Compiling, linking and signing... 1 163ms
Xcode build done. 47,6s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/n7/4j0kgb856bl9z75hy71rfmj80000gn/T/flutter_tools.TVo200/flutter_ios_build_temp_dirNtfcgE/temporary_xcresult_bundle
/Users/youssefdahar/devs/ios/Runner/GeneratedPluginRegistrant.m:12:9: fatal error: module 'add_2_calendar' not found
#import add_2_calendar;
~~~~~~~^~~~~~~~~~~~~~
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/n7/4j0kgb856bl9z75hy71rfmj80000gn/T/flutter_tools.TVo200/flutter_ios_build_temp_dirNtfcgE/temporary_xcresult_bundle
It appears that your application still contains the default signing identifier.
Try replacing 'com.example' with your signing id in Xcode:
open ios/Runner.xcworkspace
Encountered error while building for device.
I saw in the in the internet that i have to clean project and pod folder and file and reinstall, i tried many times but in vain
thanks in advance for your help
Finally I figured out that pod init and install doesn't work correctly because the file podfile generate by pod init is not the same as podfile generated by flutter run.
The solution is I deleted all pod file and folder and lock and ran flutter run once

Flutter ios : camera/CameraPlugin.h' file not found

Created Flutter application built on both an Android and iOS device. Application is working fine with android and when i build my ios build it ends up with error as shown below.
Error while executing ios build in android studio using mac device.
i try plenty of method to solve this.
**FOLLOWED SETS:**
Flutter clean
Flutter pub get
Pod install
Build.
Output
Launching lib/main.dart on iPad in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: 3MDPB894U7
Running pod install...
Running Xcode build...
Xcode build done. 52.7s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/apple/AndroidStudioProjects/console/ios/Runner/GeneratedPluginRegistrant.m:12:9: fatal error: module 'camera' not found
#import camera;
~~~~~~~^~~~~~
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.
Error launching application on iPad.
Change the target version to above 10.0.
Change in the Project Runner (in Xcode), PodFile & Target Runner (in Xcode), then run Pod Install
Make sure you open the .xcworkspace file instead of the .xcodeproj. This helped me to solve the issue.

Runner.app/Runner.app/... infinite cycle Xcode build failed

When I try to build my app, I got this error in the console:
Xcode build done. 114,3s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: '/Users/paul/AndroidStudioProjects/Chronopsi/build/ios/Debug-iphoneos/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app' is longer than filepath buffer size (1025). (in target 'Runner' from project 'Runner')
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the precompiled application for the device.
I'm on Xcode 11.3.1
I have the latest version of Flutter.
I tried to build an other old app that I already build months ago and it works fine.
EDIT:
I tried to change build to legacy but I got the same error and it's still saying "note: Using new build system" while in my log it's saying "Legacy build system detected"...
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Legacy build system detected, removing /Users/paul/AndroidStudioProjects/Chronopsi/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
Running pod install...
Running Xcode build...
Xcode build done. 57,2s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: '/Users/paul/AndroidStudioProjects/Chronopsi/build/ios/Debug-iphonesimulator/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner.app/Runner' is longer than filepath buffer size (1025). (in target 'Runner' from project 'Runner')
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Check your Xcode: Targets Runner -> Build Phases -> Copy Bundle Resources.
If Runner is in the list, remove it and do flutter clean

Flutter build iOS FAILED

I build a new flutter project from VSCode, and run on iOS simulator (iphone 11), it shows:
Launching lib/main.dart on iPhone 11 in debug mode...
Xcode build done. 11.2s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: unable to spawn process (No such file or directory) (in target 'Runner' from project 'Runner')
error: unable to spawn process (No such file or directory) (in target 'Runner' from project 'Runner')
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11.
Exited (sigterm)
Follow the below steps.
Open your Flutter project folder, in my case - helloflutter find the iOS folder and open that folder
Inside the "iOS" folder open Rinner.xcworkspace in your Xcode IDE
Once Xcode open go to Signin & Capabilities (fallow the sequence to reach Signin & Capabilities from below image)
Uncheck checkbox that Automatically manage signing from Signin & Capabilities
5. Save the changes, close Xcode, and run the Flutter code once again.

Resources