I upgraded Flutter to latest. Following is the doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.14 18A326h, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.1)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
[✓] Android Studio (version 3.1)
[✓] VS Code (version 1.27.1)
When I run the app with target to iOS simulator, I get this
Launching lib/main.dart on iPhone XS Max in debug mode...
Starting Xcode build...
Xcode build done.
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: Multiple commands produce '/Users/kalehv/dev/todo/todo-flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework':
1) Target 'Runner' has copy command from '/Users/kalehv/dev/todo/todo-flutter/ios/Flutter/Flutter.framework' to '/Users/kalehv/dev/todo/todo-flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework'
2) That command depends on command in Target 'Runner': script phase “[CP] Embed Pods Frameworks”
warning: The use of Swift 3 #objc inference in Swift 4 mode is deprecated. Please address deprecated #objc inference warnings, test your code with “Use of deprecated Swift 3 #objc inference” logging enabled, and then disable inference by changing the "Swift 3 #objc Inference" build setting to "Default" for the "Runner" target. (in target 'Runner')
warning: ignoring duplicated output file: '/Users/kalehv/dev/todo/todo-flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework' (in target 'Runner')
note: Using new build systemnote: Planning buildnote: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone XS Max.
I think this would help at least it worked for me url.
Open your Xcode and there is File upper-left next to Apple icon, then open Workspace Settings and change the build system to Legacy Build System.
I had the same problem, but when I changed to Legacy Build System I got a ton of Apple Mach-O Linker Error's instead.
I finally narrowed the problem down to a setting in Runner.xcodeproj/project.pbxproj (which can be manipulated from XCode in the Runner -> Build settings tab).
I had somehow set
Build active architecture only
- Debug No
- Profile Yes
- Release Yes
Changing it to
Build active architecture only
- Debug Yes
- Profile Yes
- Release Yes
solved the errors.
I fix this By uncommit platform target in the Podfile inside ios folder, So it will be 9.
Then you must change the platform target from Xcode to 9 this very important.
after that do this Open your Xcode and there is File upper-left next to Apple icon, then open Workspace Settings and change the build system to Legacy Build System.
then do this post link
Hit the clean button project in Xcode and run it.
I hope this will help you.
Related
I am using an M1 MacBook pro laptop and ios 13 simulator for developing a flutter app, But I am getting the below issue while trying to run the flutter app in the emulator.
This started happening when I upgraded my workspace to Flutter 2.8.
No problem while running in Android.
Please advise how to resolve this issue.
Kindly do not advise me to do the development in Xcode. I am not familiar and do not have enough bandwidth to learn new IDE. I am using VSCODE.
Launching lib/main.dart on iPhone 13 in debug mode...
lib/main.dart:1
Updating project for Xcode compatibility.
Upgrading Runner.xcscheme
Xcode build done. 1.5s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in parallel
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')
/Users/path/to/flutter/project/projectname/ios/Runner.xcodeproj: error: The linked framework 'Pods_Runner.framework' is missing one or more architectures required by this target: x86_64.
Could not build the application for the simulator.
Error launching application on iPhone 13.
Exited (sigterm)
Specify one more architecture for m1 chip.
Runner > Build Settings > Excluded Architecture > Add arm64
This solution worked for me.
I am working on a flutter app. I recently shifted to macOS and since then haven't been able to run the app. Other apps are running fine so I think the error is in within the code of this app. And maybe because of this same reason I am unable to make a build.
Here is the output of flutter doctor:
[✓] Flutter (Channel stable, 1.20.1, on Mac OS X 10.15.6 19G73, locale en-US)
• Flutter version 1.20.1 at /Users/bhawna/dev/flutter
• Framework revision 2ae34518b8 (4 days ago), 2020-08-05 19:53:19 -0700
• Engine revision c8e3b94853
• Dart version 2.9.0
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
You may also want to add it to your PATH environment variable.
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.6, Build version 11E708
• CocoaPods version 1.9.3
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
[✓] VS Code (version 1.47.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.13.2
[✓] Connected device (1 available)
• iPhone 8 (mobile) • 3D03BDE4-F1A6-45AB-B095-01107CDDC2CD • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)
Output of flutter run:
Running "flutter pub get" in delivero... 1.6s
Launching lib/main.dart on iPhone 8 in debug mode...
Running pod install... 38.2s
Running Xcode build...
Xcode build done. 449.0s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inapp_purchase-2.2.0/ios/Classes/FlutterInappPurchasePlugin.
m:45:52: warning: assigning to 'id<IAPPromotionObserverDelegate>' from incompatible type 'FlutterInappPurchasePlugin *__strong'
[IAPPromotionObserver sharedObserver].delegate = self;
^ ~~~~
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inapp_purchase-2.2.0/ios/Classes/FlutterInappPurchasePlugin.
m:200:79: warning: implicit conversion loses integer precision: 'SKPaymentTransactionState' (aka 'enum
SKPaymentTransactionState') to 'int' [-Wshorten-64-to-32]
[NSNumber numberWithInt: item.transactionState], #"transactionStateIOS",
~ ^~~~~~~~~~~~~~~~~~~~~
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inapp_purchase-2.2.0/ios/Classes/FlutterInappPurchasePlugin.
m:586:71: warning: implicit conversion loses integer precision: 'SKPaymentTransactionState' (aka 'enum
SKPaymentTransactionState') to 'int' [-Wshorten-64-to-32]
[NSNumber numberWithInt: transaction.transactionState], #"transactionStateIOS",
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/contacts_service-0.3.10/ios/Classes/ContactsServicePlugin.m:6:4:
warning: 'SwiftContactsServicePlugin' is only available on iOS 9.0 or newer [-Wunguarded-availability]
[SwiftContactsServicePlugin registerWithRegistrar:registrar];
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/contacts_service-0.3.10/ios/Classes/ContactsServicePlugin.m:2:
/Users/bhawna/delivero/delivero/build/ios/Debug-iphonesimulator/contacts_service/contacts_service.framework/Headers/contacts_serv
ice-Swift.h:213:12: note: 'SwiftContactsServicePlugin' has been marked as being introduced in iOS 9.0 here, but the deployment
target is iOS 8.0.0
#interface SwiftContactsServicePlugin : NSObject <FlutterPlugin>
^
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/contacts_service-0.3.10/ios/Classes/ContactsServicePlugin.m:6:4:
note: enclose 'SwiftContactsServicePlugin' in an #available check to silence this warning
[SwiftContactsServicePlugin registerWithRegistrar:registrar];
^~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
/Users/bhawna/dev/flutter/packages/flutter_tools/bin/xcode_backend.sh: line 13: pushd: /Users/hrvoje/Documents/Delivero
Files/contactsFeature: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 8.
Any help would be great. Thanks for your time.
Simple Commands that made my archive successful after 2 days of struggle:
flutter clean
flutter pub get
flutter pub upgrade
cd iOS
pod install
pod update
And the issue is resolved.
You won't believe it, but in my case the problem was caused by a corrupted image that was used to generate the launcher icons. Something with the alpha channel was messed up. After I fixed it, the product could be archived successfully.
In the migration try replacing the podfile with this:
https://github.com/jmagman/flutter/blob/40b21e52153e1246120e90d1c757c0ec4c34ebb0/dev/integration_tests/flutter_driver_screenshot_test/ios/Podfile
Steps:
Remove PodFile.lock
Replace Podfile
flutter clean
flutter pub get
cd ios /
pod install
pod update
relaunch
Now apparently it is an error generated by the automatic processes of the 1.20 of the flutter SDK. In my case, I removed all the plugins from my project and started placing them one by one.
In my project the error appeared because I had the plugin flutter_dotenv 2.1.0 and the .env files corrupt the automatic flutter process.
For me this error occurred because of low disc space. as I cleaned some of files and it worked
Delete podfile.lock
Ios>pod install
flutter clean
flutter run
Sometimes happen when you have this import 'dart:html'; and run the app in IOS.
Delete Run Binary from Build Phases.
Delete Thin Binary from Build Phases.
Check your image assets!
I spent days on this, upgraded flutter, upgraded Xcode, re-installed Xcode command line tools, and did every conceivable combination of flutter clean, flutter pub upgrade, pod install etc. I even used flutter create to regenerate the ios folder.
I searched for responses related to Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore because that was part of the Xcode error output, but in the end it was none of that.
I had recently added a new .png asset to my project and that was the problem. I converted it to .jpeg and the problem disappeared.
I was getting the Command PhaseScriptExecution failed error without any other details after upgrading Flutter from version 1.22.4 to 3.0.5 (and all dependencies to null-safety versions). MacOS 12.5, XCode 13.4.1.
My solution:
Delete the ios folder.
Run flutter create . from root project folder.
Remove unnecessary platform support that you don't need, I mean deleting e.g. the windows and linux folders.
Run the app just to confirm that the build is working now.
With your version control discard changes that you didn't expect (those outside ios folder): reset assets icons, set back your original bundle id, bundle display name, etc.
In the Xcode set back any "capabilities" that your app had (e.g. Push Notifications) and files added to Runner (e.g. GoogleService-Info.plist required by Firebase).
Test your app, check logs, and you're done!
Because of some dependency I also had to update iOS version in the Podfile:
platform :ios, '11.0'
Changes observerd after recreating the project:
In the ios/Podfile:
The use_modular_headers! from the top of file was removed
These 2 lines were added inside target 'Runner' do section:
use_frameworks!
use_modular_headers!
The ios/Flutter/AppFrameworkInfo.plist file was added, which was completely missing before.
Changes inside Info.plist:
MARKETING_VERSION value was replaced with FLUTTER_BUILD_NAME and CURRENT_PROJECT_VERSION with FLUTTER_BUILD_NUMBER
The following entry was added:
<key>CADisableMinimumFrameDurationOnPhone</key><true/>
These files were modified: ios/Runner.xcodeproj/project.pbxproj and ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
I don't know which of these changes made it working again, but you can try selectively some of them before you recreate the ios project from scratch.
TL;DR Try updating Flutter flutter upgrade
I had this error a few times and always try the flutter clean, flutter pub get...etc but it doesn't work, also try restarting laptop, deleting recently added assets (as some other comments suggest) but none of it works.
Then I remember how I fixed it the last time by updating Flutter, and it has just worked for me again so definitely worth a try!
Step:
Remove PodFile.lock
Remove GeneratedPluginRegistrant.h
Remove GeneratedPluginRegistrant.m
Replace podfile
flutter clean
flutter pub get
cd ios /
pod install
pod update (Use this command when you get an error in pod install)
relaunch
In my case,I got the same error when I am trying to setup flutter and run app in macbook with Apple Chip.
Flutter app ran in chrome browser but didnt work in Android emulator. I found that I had to install to rosetta.
sudo softwareupdate --install-rosetta --agree-to-license
It was also mentioned in documentation here,but somehow I got to missed that thing while setup.
The only thing that worked for me was to backup my project and clone a fresh copy from the repository. I suspect it was an issue with one of the hidden files or folders like .symlinks or Pods.
My problem is I cannot start debugging on iOS simulator for some reason. I have tried several solutions it helped in their ways I guess but the problem is not gone and I am desperate now. I don't know how exactly is this site works or is there any existing solution, but thing is I couldn't find and I need your help.
Error is here:
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running Xcode build...
Xcode build done. 45,6s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/omerugurerden/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:155:24: error: no visible #interface for 'FIRQuery' declares the selector 'queryWhereField:arrayContainsAny:'
query = [query queryWhereField:fieldName arrayContainsAny:value];
~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/omerugurerden/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:157:24: error: no visible #interface for 'FIRQuery' declares the selector 'queryWhereFieldPath:arrayContainsAny:'
query = [query queryWhereFieldPath:fieldPath arrayContainsAny:value];
~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/omerugurerden/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:163:24: error: no visible #interface for 'FIRQuery' declares the selector 'queryWhereField:in:'
query = [query queryWhereField:fieldName in:value];
~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/omerugurerden/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:165:24: error: no visible #interface for 'FIRQuery' declares the selector 'queryWhereFieldPath:in:'
query = [query queryWhereFieldPath:fieldPath in:value];
~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/omerugurerden/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:764:16: warning: 'timestampsInSnapshotsEnabled' is deprecated [-Wdeprecated-declarations]
settings.timestampsInSnapshotsEnabled = (bool)call.arguments[#"timestampsInSnapshotsEnabled"];
^
In module 'FirebaseFirestore' imported from /Users/omerugurerden/AndroidStudioProjects/faltana/ios/Pods/Headers/Public/Firebase/Firebase.h:31:
/Users/omerugurerden/AndroidStudioProjects/faltana/ios/Pods/FirebaseFirestore/Firestore/Source/Public/FIRFirestoreSettings.h:69:20: note: 'timestampsInSnapshotsEnabled' has been explicitly marked deprecated here
__attribute__((deprecated));
^
1 warning and 4 errors generated.
note: Using new build system
note: Planning build
note: Constructing build description
warning: Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')
warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')
warning: Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'in_app_purchase' from project 'Pods')
warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'in_app_purchase' from project 'Pods')
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
and my flutter doctor is here
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2 19C57,
locale tr-TR)
• Flutter version 1.12.13+hotfix.5 at /Users/omerugurerden/Developer/flutter
• Framework revision 27321ebbad (7 weeks ago), 2019-12-10 18:15:01 -0800
• Engine revision 2994f7e1e6
• Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/omerugurerden/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling
support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3.1, Build version 11C504
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (1 available)
• iPhone 11 Pro Max • E8102A9F-0AC3-497D-8DB7-44F965E3E533 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)
• No issues found!
Edit: Can it be because of I don't have developer account yet?
Worked for me:
rm ios/Podfile
Then upgrade your packages:
flutter pub upgrade
flutter pub get
And update your podfile:
cd ios && pod update
Then clean and run:
flutter clean && flutter run
I hope this will help :)
My problem was solved in this way:
flutter clean
That deleted whatever messed up configuration was causing the problem.
If you are running the Flutter project from VS Code you may not be getting all of the error information. You get more error logs if you run Flutter from the command line:
flutter run
As per the logs you are using old cloud_firestore library
Please use cloud_firestore-0.13.0+1 instead of cloud_firestore-0.12.11
Needs to enable Xcode developer mode.
Make sure the Xcode license agreement is signed by either opening Xcode once and confirming or running sudo xcodebuild -license from the command line.
For more details refer below link
https://flutter.dev/docs/get-started/install/macos
I've been having this problem a lot as well on my Mac M1. Initially it builds and runs fine but as soon as you start adding packages this error starts happening.
I tried Olle Kyrychenko solution above and it didn't work until I opened the project in Xcode, went to runner -> Info -> Configurations and changed the debug from Pods.debug to Debug (the first dropdown called runner i left as none, the second dropdown with a target I changed to debug). I did the same for release.
See Image ->
I would follow Olle Kyrychenko's solution above first though
This might help you,
flutter packages get
cd ios
pod update
then try to run again
After investigating quite a while, I found out about running flutter with the -v option (flutter run -v).
Initially I was playing around with custom icons in my app and then suddenly stumbled upon the error mentioned above. The problem was that I had structured my assets as /assets/icons/Icon.tff and forgot the assets path infront of my asset declaration:
Before:
fonts:
- family: MyFlutterApp
fonts:
- asset: icons/MyFlutterApp.ttf
After:
fonts:
- family: MyFlutterApp
fonts:
- asset: assets/icons/MyFlutterApp.ttf
I hope I can help someone not to waste so much time on this error as I did :D
Try removing the following line from ios/Podfile, which I added by following the suggestion in https://firebase.flutter.dev/docs/overview/#improve-ios-build-times.
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '6.26.0'
This solution may help you, Please check the imports, it's an error for me I changed my import like this.
import 'auth/login/login_view.dart';
to
import 'package:slgt_mobile_app/auth/login/login_view.dart';
I also had this problem sometimes, It happens if u change your project in android studios and go to the next Project, I recommend u close android studio and ios simulator and start the project again.
I import package 'package:http/http.dart' and get this error, when I removed this package dependency, this error gone.
For beginners: (tested on XCODE 12.0.1) open Xcode--> Open a project or file --> go to the flutter app path/ios directory--> open --> Runner and follow steps in attached link
Command PhaseScriptExecution failed with a nonzero exit code while trying to add Flutter to iOS app
I deleted this configuration item, success!
I found a simple solution .
just in case save backup :)
rm -rf ios // remove ios folder
flutter create -i swift . // recreate ios folder
That's it.
I hope to help you solve the problem.
WHY DID I GET THIS PROBLEM - I edited some default file in the SDK and it started to give me this error.
SOLUTION - I eliminated the folder with the SDK and unzipped again from the flutter website. So I briefly to reinstalled the SDK.
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Release ===
Swift 3 mode has been deprecated and will be removed in a later version of
Xcode. Please migrate "Runner" to Swift 4.2 using "Convert > To Current
Swift Syntax…" in the Edit menu.
Swift 3 mode has been deprecated and will be removed in a later version of
Xcode. Please migrate "Runner" to Swift 4.2 using "Convert > To Current
Swift Syntax…" in the Edit menu.
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Release ===
--path/Runner/GeneratedPluginRegistrant.m:
6:9: fatal error: 'connectivity/ConnectivityPlugin.h' file not found
#import
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.3.11-pre.10, on Mac OS X 10.13.6 17G65, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.3)
[✓] Connected device (1 available)
• No issues found!
xcode version: 10
and I'm fixing bugs of my old project
1-In Xcode >> open Product menu >> then choose clean
2-While you are in iOS folder open terminal and run pod install
Reference: https://github.com/flutter/flutter/issues/21989#issuecomment-509193686
I was facing this issue from last week. I search a lot but I didn't find anything helpful.I follow the below step to build IPA:
https://flutter.dev/docs/deployment/ios
I was trying to build IPA using projectPath/ios/Runner.xcodeproj in xcode which was wrong and throwing this error "connectivity/ConnectivityPlugin.h' file not found".
How to solve problem:
1) Close xCode.
2) Install or update POD in projectPath/ios/ using terminal.
3) ProjectPath/ios/Runner.xcworkspace open it using xCode.
4) On top menu of xCode go to Product and click on Archive.
5) To see IPA goto Top menu of xCode => Window and click on Orginazer.
Note: Nothing need to be changed in project code. Pod install/Update required.
And after successfully build IPA from projectPath/ios/Runner.xcworkspace I opened projectPath/ios/Runner.xcodeproj again and I was seeing this error. So according to my knowledge ignore this error in Runner.xcodeproj
The solution worked for me is as follows.
First do flutter clean
then goto projectDirectory/ios and open the Runner.xcworkspace file instead of Runner.xcodeproject
Then go to Product menu in the opened xcode window and click on on Archive/Build as per your need.
1. First do flutter clean
2. Secondly do flutter build ios
this is automtically run the pod install.
My Flutter application built on both an Android and iOS device prior. However since implementing the camera plugin, the application will no longer build on the iOS device.
So far I have tried:
Commenting out the use_frameworks! in the Podfile and tried both pod update and pod clean.
And adding the permissions into the iOS Info.plist file.
The code I'm running is just a default flutter application with a tab that contains the example code from https://pub.dartlang.org/packages/camera.
Flutter Doctor Output:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.2 18C54, locale en-NZ)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.3)
[✓] VS Code (version 1.31.0)
[✓] Connected device (2 available)
• No issues found!
Terminal Output:
Launching lib/main.dart on SM G950F in debug mode...
Initializing gradle... 1.6s
Resolving dependencies... 1.5s
Gradle task 'assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Gradle task 'assembleDebug'... Done 1.7s
Built build/app/outputs/apk/debug/app-debug.apk.
Launching lib/main.dart on iPad in debug mode...
Automatically signing iOS for device deployment using specified development team
in Xcode project: J6K4CJXVB4
Starting Xcode build...
├─Assembling Flutter resources... 1.4s
└─Compiling, linking and signing... 1.2s
Xcode build done. 3.9s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/Name/Desktop/math_snap/ios/Runner/GeneratedPluginRegistrant.m
:6:9: fatal error: 'camera/CameraPlugin.h' file not found
#import <camera/CameraPlugin.h>
^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Could not build the precompiled application for the device.
Error launching application on iPad.
2.5s
As you can see, it launches fine on my Android phone. However trying to run it on iOS does not work. Does anyone know how to fix this?
I would suggest to everyone who still has these issues to do the following steps:
Open the ios folder
Double click on the Runner.xcworkspace (NOT Runner.xcodeproj!)
Pod Install
Build
The problem is that the cam plugin isn't in the scope of the Runner.xcodeproj.
Did you updated your Info.plist for using the camera plugin? If not,
Add two rows to the ios/Runner/Info.plist:
one with the keyPrivacy - Camera Usage Descriptionand a usage description.
and one with the key Privacy - Microphone Usage Descriptionand a usage description.
Or in text format add the key:
<key>NSCameraUsageDescription</key>
<string>Can I use the camera please?</string>
<key>NSMicrophoneUsageDescription</key>
<string>Can I use the mic please?</string>
I had the same issue. I fixed by running pod install within my project's /ios directory
delete the podfile then flutter run again,the podfile will be auto generated again.
then build successful !!!