I'm trying to archive an app on the apple store but I get this error, everything works correctly in debug. How can I fix it?
Undefined symbols for architecture armv7:
"OBJC_CLASS$_MDFTextAccessibility", referenced from:
objc-class-ref in MDCTypography.o
"_MDFInsetsFlippedHorizontally", referenced from:
-[MDCFloatingButton insetBoundsForBounds:] in MDCFloatingButton.o
"_MDFRectFlippedHorizontally", referenced from:
-[MDCAlertControllerView layoutHorizontalButtons:actionSize:] in MDCAlertControllerView+Private.o
-[MDCAlertControllerView layoutVerticalButtons:] in MDCAlertControllerView+Private.o
-[MDCItemBarFlowLayout flippedAttributesFromAttributes:] in MDCItemBar.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Showing All Messages
Undefined symbol: OBJC_CLASS$_MDFTextAccessibility
Undefined symbol: _MDFInsetsFlippedHorizontally
Undefined symbol: _MDFRectFlippedHorizontally
Thanks!
my pod installation
My pod file
Pod in my solution:
enter image description here
Go to Build setting search Valid Architecture:
Remove armv7 from the list
If you are using Xcode version > 12.0 Then go project or target -> Build Settings -> Excluded Architecture
Then Add armv7
OR
If above do not work Then set your Run to Any iOS Device(arm64)
Now archive your build.
Set the parameter iOS Deployment Target of MaterialComponents pods to iOS 11.0
https://github.com/jonasbark/flutter_stripe_payment/issues/217
Related
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?
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.
I have created a framework & integrated in the another app(Demo). When i run this Demo app on simulator then there is not any error...
But when do i run on device its gets error.
ld: warning: ignoring file /Users/mac/Desktop/library file/Demo/pk.framework/pk, file was built for x86_64 which is not the architecture being linked (arm64): /Users/mac/Desktop/library file/Demo/pk.framework/pk
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_InterstitialAdView", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please share your experience.
I am using Xcode 9.0
Thanks
You have to know simulator and devices have different cpu types, when you build Xcode will build the app and link the libraries according to the target type.
From the error info, it seems your framework only provide the x86_64 architecture (for simulator), you should build your framework for the device architecture (arm64) instead !
I have just added 64 bit support for my iPad app in Xcode. Before the update i was able to archive the app with no red errors. After i add arm64 in the build settings get 2 error preventing the archive:
*ld: warning: ignoring file /Users/****/Documents/mApp/****/Pixate.framework/Pixate, missing required architecture arm64 in file /Users/****/Documents/mApp/****/Pixate.framework/Pixate (3 slices)
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_Pixate", referenced from:
objc-class-ref in main.o
objc-class-ref in BaseView.o
objc-class-ref in BaseViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)*
I have checked the framework and it is showing in the frameworks in the project.
I am currently using Xcode version 6.3.2 (6D2105)
The problem is related to third party framework Pixate.framework.
This framework is not built for arm64. That's why you got these errors.
How to fix it: find the version of this framework that was built with arm64 or just build it yourself by getting code from GitHub
I have a project that uses CocoaPods. It was working but something got broken.
It does compile if I target the simulator, but If I target the devise (Build or Archive) it throws a linker error.
ld: warning: ignoring file /Users/myuser/ios/share/share/libPods.a, file was built for archive which is not the architecture being linked (armv7s): /Users/myuser/ios/share/share/libPods.a
Undefined symbols for architecture armv7s:
"_OBJC_CLASS_$_AFHTTPRequestOperationManager", referenced from:
objc-class-ref in BackendProxy.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I really need some help because I am really stucked.
Thanks!
EDIT: i deleted that libPods.a, that was an old one, and now it's giving me:
ld: library not found for -lPods
But only on Archive or Build for iosDevice, this is still working on the simulator.
Try removing armv7s from valid architectures section.
Build Settings -> Architectures -> Valid Architectures
Today I have added to my project MWPhotoBrowser using cocoapods source control.
Tests in emulator where correct but when I start to test app on devices (ipode touch 5gen and iphone 4s) I got few issues:
ld: warning: directory not found for option '-L/Users/user/Pods/build/Debug-iphoneos'
Undefined symbols for architecture armv7s:
"_OBJC_CLASS_$_MWPhotoBrowser", referenced from:
objc-class-ref in KYMUFinalPageTVC.o
"_OBJC_CLASS_$_MWPhoto", referenced from:
objc-class-ref in KYMUFinalPageTVC.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If you get this error with MWPhotoBrowser and you're in Xcode 6.1, then do this,
Go to your project -> Build Settings, and search for "Other Linked Flags" and add $(OTHER_LDFLAGS) to it.
Source:
https://stackoverflow.com/a/26721045/1032179