Flutter; Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1eb0e27a0) and ?? (0x1162f02b8) - flutter

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.

Related

Error Module 'flutter_secure_storage' not found when try Product ->Build for -> Profiling

well this error occurs to me when I try to make my app in production.
The app is created with flutter and I was able to create the apk for android, but when I try to do it for ios it won't let me.
The file that I am opening is Runner.xcworkspace and the problem is the import of a flutter library, it seems to me that I have to make some kind of connection with the pods.
here is the error, I want to tell you that I do not want to run the app, but to make an installer
The error that occurs when building a release (ie. flutter build ipa) and not when running a debug build is:
/[REDACTED]/ios/Runner/GeneratedPluginRegistrant.m:48:9: fatal error: module
'flutter_secure_storage' not found
#import flutter_secure_storage;
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
For me regenerating Podfile in the following way solved the issue:
rm ios/Podfile && flutter build ios
See Closed [ios][release] GeneratedPluginRegistrant.m Module not found
#43986

Flutter error: xcodebuild: WARNING: Using the first of multiple matching destinations

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

Build error of react native run iOS on M1 Macbook

I initialized new react-native project with "react-native init ReactNStudy" for first time on my M1 Silicon Apple computer.
Metro builder worked without any problems.
When building step I get very log error. Starting part of the error like that:
info Found Xcode workspace "ReactNCalisma.xcworkspace" info Launching iPhone 12 (iOS 14.4) info Building (using "xcodebuild -workspace ReactNCalisma.xcworkspace -configuration Debug -scheme ReactNCalisma
-destination id=E914C899-172A-45AE-AFB6-BEBA505887E1") (node:25639) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use `node --trace-warnings ...` to show where the warning was created) error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening ReactNCalisma.xcworkspace. Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace ReactNCalisma.xcworkspace -configuration Debug -scheme ReactNCalisma -destination id=E914C899-172A-45AE-AFB6-BEBA505887E1
And ending part of the error like that:
objc[25723]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1fc2be7a0) and ?? (0x1189b42b8). One of the two will be used. Which one is undefined.
objc[25723]: Class AMSupportURLSession is implemented in both ?? (0x1fc2be7f0) and ?? (0x1189b4308). One of the two will be used. Which one is undefined.
** BUILD FAILED **
The following build commands failed:
Ld /Users/USERNAME/Library/Developer/Xcode/DerivedData/ReactNCalisma-anxlznepgpgzoyfpokskqpwmffzt/Build/Products/Debug-iphonesimulator/ReactNCalisma.app/ReactNCalisma normal
(1 failure)
info Run CLI with --verbose flag for more details.
After that I tried to run with "xcodebuild":
cd ios && xcodebuild
But in this part I get error as:
fatal error: module map file
'/Users/USERNAME/Desktop/Projects/ReactNCalisma/ios/build/Release-iphoneos/YogaKit/YogaKit.modulemap'
not found
** BUILD FAILED **
The following build commands failed:
CompileC /Users/USERNAME/Desktop/Projects/ReactNCalisma/ios/build/ReactNCalisma.build/Release-iphoneos/ReactNCalisma.build/Objects-normal/arm64/ReactNCalisma_vers.o /Users/USERNAME/Desktop/Projects/ReactNCalisma/ios/build/ReactNCalisma.build/Release-iphoneos/ReactNCalisma.build/DerivedSources/ReactNCalisma_vers.c normal arm64 c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/USERNAME/Desktop/Projects/ReactNCalisma/ios/build/ReactNCalisma.build/Release-iphoneos/ReactNCalisma.build/Objects-normal/armv7/ReactNCalisma_vers.o /Users/USERNAME/Desktop/Projects/ReactNCalisma/ios/build/ReactNCalisma.build/Release-iphoneos/ReactNCalisma.build/DerivedSources/ReactNCalisma_vers.c normal armv7 c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
I tried to solve with Pod delete and reinstall, I checked my Xcode terminal settings but I cannot solve this problem .
Is this problem about M1? How can I solve this?
I followed those steps on macbook M1 (problem with cocoapoda and build):
1- Using Terminal with Rosetta (Make sure all terminals are closed):
Go Finder --> Applications --> Utilities --> Terminal (Then right click on Get Info - check Open using Rosetta)
Now you can open Terminal & install Cocoapoda from terminal
2- Use Xcode with Rosetta (Make sure that Xcode is closed):
Go Finder --> Application --> Xcode (Then right click on Get Info - check Open using Rosetta)
Now Xcode/simulator will work as Rosetta
3- Comment this part in Podfile (in ios folder)
# use_flipper!
# post_install do |installer|
# flipper_post_install(installer)
# end
Then reinstall pod:
cd ios/
$ rm -rf build/
$ pod install
Check this video:
https://youtu.be/UrxM1SyAXAE
I had same problem. I fixed as below
I added into the Podfile
post_install do |installer|
react_native_post_install(installer)
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
pod install
I also experienced same issue before. But, Now i can compile and build react native run-ios sucessfully.
I already resume and create guide article on how to run react native iOS Macbook with M1 Chip.
Quick step:
- set terminal to use Rosetta
- set XCode to use Rosetta
- small adjust on podFile if you have problem with react native flipper.
full guide follow from this : https://handi.dev/blog/how-run-react-native-on-macbook-m1-apple-silicon
If you didn´t find the answer yet:
I had the same issue and fixed it by downgrading my node.js version.

Tried archiving flutter project with no disc space left, can't fix errors

Question upfront: How can I thoroughly clean/repair my flutter project to allow it to run/build again?
I had been building and archiving (in Xcode) flutter projects without issue until just now.
My computer ran out of disc space mid archive and forced it to stop with "nonzero exit code".
I deleted a bunch of things on the computer to make space, and now it says there is >100gb left.
I was due for a flutter upgrade, so I ran flutter upgrade, which completed without error.
I closed android studio and Xcode and restarted my computer.
I ran flutter clean as well as clean within Xcode.
I can no longer run the app within flutter or run/archive within Xcode.
The exact errors seem variable, but here are some of them that I see:
Running from Xcode:
.../ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h:292:13: Cannot find protocol declaration for 'FlutterTextureRegistry'; did you mean 'FlutterPluginRegistry'?
.../ios/Flutter/Flutter.framework/Headers/FlutterEngine.h:54:38: Cannot find protocol declaration for 'FlutterTextureRegistry'; did you mean 'FlutterPluginRegistry'?
.../.pub-cache/hosted/pub.dartlang.org/in_app_purchase-0.3.1+2/ios/Classes/FIAPReceiptManager.m:13:9: Could not build module 'Flutter'
Running from Flutter (I can't paste all of the errors... way too long):
^~~~~~~~~~~~~~~~~~~~~~
FlutterPluginRegistry
While building module 'Flutter' imported from .../.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.5/ios/Classes/FLTPathProviderPlugin.h:5:
In file included from :1:
In file included from .../Documents/Flutter/patient_medical_record/ios/Pods/../Flutter/Flutter.framework/Headers/Flutter.h:54:
In file included from .../Documents/Flutter/patient_medical_record/ios/Pods/../Flutter/Flutter.framework/Headers/FlutterAppDelegate.h:11:
.../Documents/Flutter/patient_medical_record/ios/Pods/../Flutter/Flutter.framework/Headers/FlutterPlugin.h:395:11: note: 'FlutterPluginRegistry' declared here
#protocol FlutterPluginRegistry
^
3 errors generated.
In file included from .../.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.5/ios/Classes/FLTPathProviderPlugin.m:5:
.../.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.5/ios/Classes/FLTPathProviderPlugin.h:5:9: fatal error: could not build module 'Flutter'
#import
~~~~~~~^
4 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Well this is a bummer because I can't find a clean solution, but for now I did fix it with the following:
Create a new flutter project
Copied over the lib files
Copied over other setup in random places (i.e. google services, android changes)
Copied over pubspec.yaml and ran packages get
It now works again. Clearly something went wrong in the Flutter-managed files that I don't understand. If someone else can think of a better solution to effectively reset the project, please share.

Cannot build any Swift project at all due to strange error about MacOSX10.11.sdk

I'm running macOS 10.12.3 with Xcode 8.3.
I cannot build any macOS Swift projects with it.
If I create a new Cocoa application Xcode project and set it to use Swift, when I try to compile it, I immediately get the following error in the "check dependencies" phase:
error: There is no SDK with the name or path '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk'
I have no idea what's going wrong!
The only clue I have is that earlier I created a symlink with the path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk that pointed to MacOSX.sdk in order to fix an issue where an older build of Qt that required an SDK with that path. However, deleting the symlink has no effect.
I can build Swift projects that targeting other platforms like iOS. Just not macOS.
Help!
try running this command then reopening the project
(Xcode uses xtools in the command line to build its projects)
sudo xcode-select -switch /path/to/file/
(by default the path is)/Applications/Xcode.app/
look at this pic
saw it here yesterday