My project, in iPhone5s simulator running above normal, but iPhone5 compile error, an error message is as follows:
ld: warning: directory not found for option '-L/Users/apple/Desktop/……/UMSocial_Sdk_3.3.7'
ld: warning: ignoring file /Users/apple/Desktop/……_SDK/lib/libP2P_device.a, missing required architecture i386 in file /Users/apple/Desktop/……_SDK/lib/libP2P_device.a (2 slices)
ld: warning: ignoring file /Users/apple/Desktop/……/UMAnalytics_Sdk/libMobClickLibrary_armv6.a, file was built for archive which is not the architecture being linked (i386): /Users/apple/Desktop/……_Sdk/libMobClickLibrary_armv6.a
ld: warning: ignoring file /Users/apple/Desktop/……_iOS_SDK/lib/libP2P.a, file was built for archive which is not the architecture being linked (i386): /Users/apple/Desktop/……2P.a
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_InterfaceJump", referenced from:
objc-class-ref in CommonFunc.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Your project link some file didn't support i386 architecture. Maybe this file ??just support arm architecture.
You should make sure your "Build Settings" -> "Valid Architectures" didn't contain i386. iPhone5's architecture is "armv7", it shouldn't compile for architecture i386.
If your just want to build target phone architecture, you can set "Build Active Architecture Only" to YES.
I sorry, I think your iPhone5 is device, you can try to change "Valid Architecture" to only support 64bit or 32bit arm architecture, and change "Build Active Architecture Only" to have a try.
iPhone5 simulator is build fine, and iPhone5s build failed usually is arm64 problem.
Related
I use this pod to show ads in the app: https://cocoapods.org/pods/AdColony
I completed the SDK implementation with no errors.
But I'm getting this error when I try to run the app on the device: (iPhone)
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_SKAdImpression", referenced from:
objc-class-ref in AdColony(ADCAdSession.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
What I tried:
In build settings, set ARCHS = armv7 armv7s and VALID_ARCHS = armv6 armv7 armv7s arm64.
In build settings, added $(inherited) to Other Linker Flags.
In build settings, set Build Active Architecture Only to YES.
Downloaded the pod added to the project manually.
Checked the minimum deploy target version of the SDK. That fits with the project.
Unchecked Parallelize Build in Product > Scheme > Edit Scheme
How can I solve this problem?
I had this question going on, but now I am a little further:
I added this framework to my project:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/AdSupport.framework
Now this works fine if I run the app on any device, however this framework is just for the architectures armv7, armv7s and arm64
When running the app on the simulator, the build fails because the architecture i386 is missing. This is included in:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/AdSupport.framework
How can I achieve that all architectures can be used? I played a lot with the build-settings but nothing worked so far!
error report:
ld: warning: ignoring file /Users/XXXXXXX/Documents/app1/app1/AdSupport.framework/AdSupport, missing required architecture i386 in file /Users/XXXXXXX/Documents/app1/app1/AdSupport.framework/AdSupport (3 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ASIdentifierManager", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADDevice.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thanks a lot!
Go to the Project Target.and make architecture like below image.
/Users/XXXXXXX/Documents/app1/app1/AdSupport.framework/AdSupport is missing an i386 slice; I suspect that it was likely built for arm and not intel. It looks like that framework is external to your project, so I suggest you rebuild it for the simulator.
You can check the current architectures of the framework by running file /Users/XXXXXXX/Documents/app1/app1/AdSupport.framework/AdSupport
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
I'm using TestFlightSDK, when i run on any other simulator it works without issues, only when i test against iPhone 5s simulator (( 64-bit )) i get an error about testflight lib and pod project :\
This is the error:
ld: warning: ignoring file
/Users/lightdream/Library/Developer/Xcode/DerivedData/PECO-gwvmtuvxtbegjiasbpanfvzmzery/Build/Products/Debug-iphonesimulator/libPods.a,
file was built for archive which is not the architecture being linked
(i386):
/Users/lightdream/Library/Developer/Xcode/DerivedData/PECO-gwvmtuvxtbegjiasbpanfvzmzery/Build/Products/Debug-iphonesimulator/libPods.a
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MFSideMenuContainerViewController", referenced from:
objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1
(use -v to see invocation)
I don't knew how this happened, and couldn't figure it out :\
Note: the files are there, and it's compiling against all other simulators, ( including ipad ), it's not missing files thing, it doesn't find the library only on iPhone(64-bit) simulator.
Check your build phase and make sure you have all the .m files and .a lib files are there
How to build a static library for simulator on Xcode 4.6?
I've tried "https://github.com/kstenerud/iOS-Universal-Framework". But got an error while using that framework on demo.
Error is like:
ld: warning: ignoring file /Users/shuvo/test_lib/Demo(V.1)/myProject.lib/libMyProjectLibrary.a, missing required architecture i386 in file /Users/shuvo/test_lib/Demo(V.1)/myProject.lib/libMyProjectLibrary.a (2 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_showScreen", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I came across the same problem,and solve it by setting the static lib's run configuration as Release in the scheme editor.
here is the words in the document of iOS-Universal-Framework, section "Building your iOS Framework":
step 2.(optional) Set the "Run" configuration in the scheme editor.
It's set to Debug by default but you'll probably want to change it to
"Release" when you're ready to distribute your framework.
the key is the "Build Active Architecture Only" in Build Settings,
Debug is set to NO by default