How to make framework support architecture x86_64? - ios

I made my own framework and everything was fine. But when Apple releases 64bit architecture when another project uses 64-bit architecture my framework doesn't want to compile.
When I changed architecture of project just armv7 and armv7s - it complies good but when i changed architecture back to arm64 - it produces error -
(null): "_OBJC_CLASS_$MYFramework", referenced from:
objc-class-ref in RWAppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
So I've changed architecture of framework to include arm64, but error in my project still there
Is there another way to support arm64?
I added a screenshot of support architectures of framework

From error description you provided I can see that:
During linking phase for Intel 64bit architecture _OBJC_CLASS_$MYFramework symbol was not found. Which is quite strange as you sure you compiling for arm architecture. Maybe you should revise Makefiles of your framework?
Have a look here Shell you make target IOS7 32bit?

Related

Library not working on simulator

Hello I'm using a library in my project, and basically it's working on real devices, but not on simulator.
I would like to know how to add compatibility with simulator also.
I've search around, and I found some answers that should have solved my problem, but they're not doing it. (Maybe I'm doing things wrong, but still not working).
I'm getting this error:
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_Library",
referenced from:
objc-class-ref in class.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code
1 (use -v to see invocation)
I tried it on xcode7 and xcode8.
Thanks.
Maybe you're using a framework or library which was only built for ARM architecture. In that case you'll have to create fat binary which will include code for all platforms (x86 for simulator, ARM and ARM64 for iOS devices).

ios – Xcode Errors Undefined symbols for architecture armv7 -MIsnap

We have an iOS app which uses MISNAP SDK version (2.3) as part of scanning functionality and it was working fine. Since the recent update came for MiSnap which is of version 3.0 and we wanted to update the library in our said application. We followed the docs and we replaced the necessary libraries and we are stuck with below errors even after multiple tries of resolving it.
"_OBJC_CLASS_$_MiSnapViewController", referenced from: objc-class-ref
in DCVC.o objc-class-ref in CCVC.o ld:
symbol(s) not found for architecture armv7
clang: error: linker
command failed with exit code 1 (use -v to see invocation)
We dug up in internet searching solution for this issue and came along with this post but we did not find any solution for the above error. We also created a sample project with the new version of the SDK and it works well. We doubt that this might be some configuration issue which we are unable to figure even after multiple tries.
Below is the current configuration for our application
Deployment Target - 7.1 and above
Base SDK - latest(9.0)
Build Active architecture only - Yes
Valid architectures - armv7 armv7s arm64

XCode 6.1 Missing required architecture X86_64 in file for extern library

I have an issue when trying to use an external lib : I can't compile the project as it throws an exception as below.
ld: warning: ignoring file /Users/renaudcousin/Documents/XCode/WORK/StimShopPOC/StimShopPOC/libStimshop_SDK.a, missing required architecture x86_64 in file /Users/renaudcousin/Documents/XCode/WORK/StimShopPOC/StimShopPOC/libStimshop_SDK.a (3 slices)
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_StimshopSDK", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)`
I tried lots of solutions found on stackoverflow (but for XCode 5.1 and not as well explained) without any change ...
I also found this topic XCode 6.1 Missing required architecture X86_64 in file that exactly correspond to my problem and
when looking at my lib's architecture with lipo -info command, it seems it's missing i386 and x86_64. How could I add them to my library architectures to be able compile ?
This means your .a library doesn't contain the x86_64 architecture (You can run lipo -info /path/to/your/lib.a to verify it). If you don't have the source code of the library, you have to modify your own project. In the build settings, change the valid architectures to armv7 and i386, or change Architectures to armv7 only. However, by doing so, your project won't be compiled to the arm64 architecture, which is required when uploading to the App Store after Feb 2015, according to Apple's announcement.
If your library doesn't contain x86_64 architecture, it is likely that it doesn't contain arm64 either. So you should avoid using old libraries.
If a library doesn't have the X86_64 architecture you can build it if you've picked a connected device rather than a simulator for your build target.
Basically, you can still build and develop but you can't use the simulator.
Click on your project > build setting > architecture. Change architecture as armv7 and delete others like armv6,etc, Then it will work :-
In the project that builds libStimshop_SDK.a, be sure the "Architectures" setting is set to $(ARCHS_STANDARD) and that it includes 64-bit settings in the compiler settings. Be sure the "Valid Architectures" setting includes 64-bit as well.

IOS linking with missing architecture i386 (AdSupport.framework)

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

add framework to static library xcode

i am trying to add this mpos.framework to my Static library but i get this :
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MPMpos", referenced from:
objc-class-ref in libSerenity.a(Widget.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
i should add the mpos.framework to the DependentApp also?
i should add the mpos.framework to the DependentApp also? - You can easily answer this by trying it.
My guess is that this is not your problem. It looks like mpos.framework (and its internal library) is not FAT library and is compiled for ARM architecture(s) only. It probably do not contain i386 (simulator) version of the compiled code. You can find more information about FAT libraries here: Build fat static library (device + simulator) using Xcode and SDK 4+

Resources