Reputation: 771
I'm building app on iOS (Xcode) using Flutter. Debug build works well, however when I build for release, I receive an error.
ld: warning: ignoring file /Users/mac/Library/Developer/Xcode/DerivedData/Runner-goymfovmnvitvmgsgblaexbdslkp/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/stripe_native/stripe_native.framework/stripe_native, building for iOS-armv7 but attempting to link with file built for iOS-arm64
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_StripeNativePlugin", referenced from:
objc-class-ref in GeneratedPluginRegistrant.o
ld: symbol(s) not found for architecture armv7
I had a look around, tried to set Build Active Architecture Only to No, Link Binary to Libraries - nothing seemed to work.
What should I do in this case?
Upvotes: 1
Views: 1318
Reputation: 99
The underlying problem is iOS 11 has dropped support for the armv7 architecture and one of your Deployment targets is probably set to < 11.0 and another is set to >= 11.0 or not set. When the target is less than 11.0 armv7 is built, when the target is >= 11.0 or not set armv7 is not built.
The problem in my case was my app's deployment target was set to iOS 10, but my Pod's target was not set (thus building for the latest iOS 13). For this particular case it was for the UIDeviceIdentifier target. The error was:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_UIDeviceHardware", referenced from:
objc-class-ref in ....
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
In this particular case I was just updating my pods so the pod's settings must've been cleared. In the Pod's target settings under the Build Settings tab, I set the iOS Deployment Target to 10.0 (same as the app) and it worked.
As an alternative, I could've set the app's deployment target to 11.0.
Upvotes: 1