How to switch flutter plugin architecture from arm64 to armv7 - ios

When I tried to decrease my flutter app's deployment target (iOS 12 to 9.3), I received this error when running flutter build ios:
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Release ===
fatal error: lipo: -extract armv7 specified but fat file:
/Users/xxx/development/myapp/build/ios/Release-iphoneos/Runner.app/Frameworks/flutter_webview_plugin.framework/flutter_webview_plugin does not contain that architecture
Failed to extract armv7 for /Users/xxx/development/myapp/build/ios/Release-iphoneos/Runner.app/Frameworks/flutter_webview_plugin.framework/flutter_webview_plugin. Running
lipo -info:
Architectures in the fat file: /Users/xxx/development/myapp/build/ios/Release-iphoneos/Runner.app/Frameworks/flutter_webview_plugin.framework/flutter_webview_plugin are:
arm64
I am unable to find any information on how to change the architecture in question - can I even do this? Or is this something the plugin developer has to build in?
I would like to be able to run the app with the lowest possible iOS version for maximum compatibility.

In the project build settings, there is a section called Architectures, there you can set the ones you need. As far as I know, the latest iPhones need to use arm64, but in my picture you can see that I'm also set as valid armv7, that seems to be your problem.

Related

Which architectures are used when I compile something for iOS?

I try to understand the different architectures for iOS, and when I need which.
I have a Hello World example. Is my assumption correct that, if I run it in the Xcode Simulator, I need to compile everything including my dependencies for x64 (because it's running on my computer).
And for my attached iPhone it's getting compiled for only that architecture. And for Generic iPhones my example will be a multiarchitecture app (arm64 arm64 armv7 armv7e) so it can run on a variety of architectures. Is that correct?
Thanks for your insight.
P.S. So if my example links foo.a, but foo.a is just arm64 arm64 armv7 armv7e but not x64, I could compile my app for iPhones but not run it in my simulator
This is essentially correct although you have two arm64 listed above; it should be arm64 and arm64e.
As to what architectures get built, it depends on the setting "Build Active Architecture Only". The typical Debug config has this set to Yes, so it only builds for the architecture of the device that you're targeting.
A Release config has this set to No, so it compiles for all architectures specified in "Architectures", which usually $(ARCHS_STANDARD), i.e., the architectures you listed.
As to your PS, you are correct that a .a file with only ARM archs could not be linked to a Simulator target.

Xcode 6.3 missing required architecture arm64 [duplicate]

Just upgraded to Xcode 5.1, getting the following error:
ignoring file
...Dependencies/SalesforceNetworkSDK/libSalesforceNetworkSDK.a,
missing required architecture arm64 in file
...Dependencies/SalesforceNetworkSDK/libSalesforceNetworkSDK.a (3
slices)
If I turn off build active archs only and remove arm64 from valid archs I get:
Build/Products/Debug-iphoneos/libPods.a, file was built for archive
which is not the architecture being linked (armv7)
According to apple's release note, see the following note point.
Note:
Be aware of the following architectures issues when opening your
existing projects in Xcode 5.1:
When building for all architectures, remove any explicit
architectures setting and use the default Standard Architectures
setting. For projects that were previously opted-in using “Standard
Architectures Including 64-Bit”, switch back to the “Standard
architectures” setting.
When opening an existing project for the first time, Xcode 5.1 may
display a warning about the use of the Xcode 5.0 architectures
setting. Selecting the warning provides a workflow to revise the
setting.
Projects not able to support 64-bit need to specifically set the
architectures build setting to not include 64-bit.
So you've to set architecture as below to support libs architecture.
Reference from this post.
Update: From May 15, you've to take build from 5.1.1, see this post.
Don't know previous iOS but Setting Build Active Architecture Only to YES in iOS 8 did the trick.
I ended up getting my project to build by (1) turning off build active archs only (2) removing arm64 from valid archs and (3) making sure that the Pods project was building for only armv7 and armv7s.
Also worth noting here, that at the time of writing this edit, Salesforce mobile SDK was not available for arm64
I just changed the Debug from Yes to No,
Build Settings -> Architectures -> Build Active Architecture Only -> Debug -> NO.
This one fixed my error.

Xcode Validating App: No architectures?

i using xcode 5.1 and i would like to validate my product. Here is the error, that i get:
No architectures in the binary. Lipo is failed to detect any architectures in the bundle executable
I have Standard Architectures in the Build Settings and armv7 and armv7s in Valid architectures(i tried even with all of them) and Build active architectures is set to No.
I have no idea what happening here. I think if i can't resolve this I'll Distribute it without Validation... Please help me
My Deployment target is 7.0
Check your target deployment target and Architectures.
Kindly refer this link as well Xcode 5 and iOS 7: Architecture and Valid architectures

SQLCipher for iOS, running on armv7s and armv devices

So I've had some headaches today trying to solve this one. I have SQLCipher integrated into an iOS application and before I go further, here are my architecture build settings:
As I understand it, this should only build for an armv7s device (such as a iPhone 5), and when trying to run on a armv7 device I quite rightly get this error:
So I try changing the project's build architecture to Standard (armv7s, armv7) and build. This still runs as expected on the armv7s device, but on a armv7 device I get these linking errors:
So naturally I check out the build settings for the library throwing these errors, and they both have armv7 and armv7s in the valid architecture setting, so does anyone know why am I getting those build errors on the armv7 device? I am missing something?
Here are the build settings for the libraries I'm using (openssl-xcode and sqlcipher):
To fix this read the comments above from Stephen and then I did a project clean and rebuilt it.

Failed Xcode build: no rule to process file for architecture armv6

Building my iOS App in Xcode 4.5 results in Dependency Analysis Warnings for every source file:
warning: no rule to process file of type sourcecode.c.objc for architecture armv6
This eventually results in a missing binary. Any ideas what's wrong here?
Build settings: armv6 armv7 Valid Architectures and iOS 4.3 Deployment Target.
Xcode 4.5 does not support building armv6 binaries anymore.
Set Valid Architectures to armv7.

Resources