Failed to build Flutter app in iOS emulator for architecture arm64 - flutter

I am encounter this error when first time I build my flutter app in iOS simulator (it works normally on android)
Device: MacbookAir M1
Flutter: 3.3.10
Xcode: 14.2
In
/Users/paramaartha/Documents/Flutter/komplekku_user/ios/Pods/Sodium/Sodium/libsodium/libsodium-io
s.a(libsodium_la-aead_chacha20poly1305.o), building for iOS Simulator, but linking in object file
built for iOS, file
'/Users/paramaartha/Documents/Flutter/komplekku_user/ios/Pods/Sodium/Sodium/libsodium/libsodium-i
os.a' for architecture arm64
Anyone know how to fix it?
I tried to add exclude architecture and run Xcode in rosseta but nothing work

Related

Flutter Will not run on IOS Simulator - Pods_Runner.framework' is missing one or more architectures

I upgraded to Flutter 2.5.0 and now I cannot run on an IOS simulator, from either Android Studio or the command line.
It fails with the error
Runner.xcodeproj: error: The linked framework 'Pods_Runner.framework' is missing one or more architectures
required by this target: arm64. (in target 'Runner' from project 'Runner')
I can manage to run on the Simulator from XCode without an issue
I can run on a device from Android Studio or command line
I have tried
restarting the simulator.
cleaning the build folder
upgrading Cocoapods to 1.11.1
Flutter Doctor says that everything is fine.
----------------- Edit ------------------
The situation Eventually Resolved Itself.
This is a problem because of ARM64 for me. This helped for me.
Be sure to open .xcworkspace.
Adding "arm64" to Project -> Build Settings -> Excluded Architecture
The reason why this might have been happened is because Xcode has been updated to a newer version. You gotta love Xcode..

Xcode error: building for iOS Simulator, but linking in object file built for iOS

Never had a lot of problems until the time to buy Macbook Air M1. Just yesterday my app was build without any error in Xcode 12.4. I did not make any special changes and today build failed:
/Users/userName/Projects/MyApp/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(cryptlib.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/userName/Projects/MyApp/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a' for architecture arm64clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please can you help me, how to solve it?
Looks like a missing Arm64 simulator slice in the OpenSSL-Universal CocoaPods distribution.
Make sure that you're using the latest version with pod update and contact the OpenSSL-Universal if there's still an issue.

Could not find module 'SJSegmentedScrollView' for architecture 'armv7'; found: arm64

The problem shows when I try to build to real device as simulator. But, there's no problem when I build in simulator.
XCode : 10.2.1
Swift : 4.0
iOS : 10.3.3
Can you check if you are using Debug or Release to build? I've had a similar issue before with other modules, for example you can run the Onfido SDK on simulators on Debug but not on Release. By the looks of this error you are using the Release SDK.

Build error when building iPad app for UIKitForMac

When attempting to build an iPad app for Mac using Catalyst, I get the following error:
FirebaseAnalytics.framework/FirebaseAnalytics(...o),
building for UIKitForMac, but linking in object file built for iOS Simulator,
file '/../FirebaseAnalytics.framework/FirebaseAnalytics' for architecture x86_64
Is this something Google has to fix? The version is FirebaseAnalytics 6.0.1
The Firebase libraries are not yet ported to UIKitForMac / Catalina, so it's best to conditionally compile out the usages like so:
#if !targetEnvironment(UIKitForMac)
...firebase code...
#endif

Can't debug on iOS 4.x devices

Whenever I try to debug on devices with iOS 4.x (iPhone 4 and 3GS) I get the following error:
error: failed to launch '/XXX/Library/Developer/Xcode/DerivedData/XXX-fytptbaixvmoweacfsniqxtvjkst/Build/Products/Debug-iphoneos/XXX.app/XXX'
-- Bad CPU type in executable
On devices with iOS 5.x it works.
I am using xCode 4.3.3 and my configurations are:
Architectures: Standard (armv7) (also tried armv6,armv7 to no avail)
Base SDK: Latest iOS (iOS 5.1)
Valid Architectures: armv6, armv7
Deployment Target: iOS 4.0
What do you think?
In your Xcode preferences, go to downloads tab and install "iOS 4.0 - 4.1 Device Debugging Support".
This package includes information and symbols that Xcode needs for
debugging your app on iOS devices running versions of iOS prior to iOS
4.2. If you intend to debug your app on a device running one of these versions of iOS you should install this package.