iOS simulator linker command failed - ios

I am trying to launch my iOS app on the simulator but it does not work. Running the app on the phone works normally though. It has something to do with my admon integration. Before the simulator was running smoothly. I am using Xcode 6.1.
I added all required frameworks:
AdSupport
AudioToolbox
AVFoundation
CoreGraphics
CoreTelephony
EventKit
EventKitUI
MessageUI
StoreKit
SystemConfiguration
as well as libGoogleAdMobAds.a
The error I get is:
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)

Go to "info" in project settings and clear library search paths, and then re-add the libGoogleAdMobAds.a framework

The library most probably does not contains any i386 binary slice. It probably contains slices for devices -- 3 "iPhone" architectures: armv7, armv7s, arm64 -- but not the simulator architecture, which runs on your computer.
Since the binary slice can't be found, the linker is missing symbols to make the i386 executable, and it can't be run in the simulator.

Where did you get the AdSupport.framework from? I now realize it's in your Documents directory.
Normally you should link the target from Xcode, by going in the target settings:
then Build phases > Link binary with libraries:
search for "AdSupport", it should be under iOS8.1:
the library should be there:

Related

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

Undefined symbols for architecture i386 Facebook SDK

I'm creating a new tabbed iOS application in xCode 5.1.1. I'm had done research but none of the solutions work to me. So I ended up with migration from xCode 6.1 to xCode 5.1.1. But the problem still occur which I have no idea now. Perhaps the settings in architecture i386 need to be changed. But I have no idea how.
Error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ASIdentifierManager", referenced from:
objc-class-ref in FBAudienceNetwork(FBAdUtility.o) "_OBJC_CLASS_$_CMMotionManager", referenced from:
objc-class-ref in FBAudienceNetwork(FBAdAnalogInfo.o) ld: symbol(s) not found for architecture i386 clang: error: linker command
failed with exit code 1 (use -v to see invocation)
Build Settings
Standard architectures(armv7, armv7s, arm64) - $(ARCHS_STANDARD)
Build Active Architecture Only : YES / NO
Update:
After adding CoreMotion and AdSupport frameworks, errors had been reduced. But left one more error which state:
missing required architecture x86_64 in file {DIRECTORY}/FacebookSDK/Bolts.framework/Bolts (2 slices)
duplicate symbol _OBJC_IVAR_$_AppDelegate._window in
Current Framework:
CoreMotion
AdSupport
CoreGraphics
FacebookSDK
UIKit
FBAudienceNetwork
Foundation
Bolts
You need to link
AdSupport.framework
CoreMotion.framework
Did you remove Sample folder after dragging in the FacebookSDK into Frameworks group of your Xcode project? I had the same issue, and it was because Xcode tried to compile all the samples too. Removed Samples folder - everything works as a charm - no need to add AdSupport or any other framework.
You probably didn't add AdSupport.framework.
set property for architecture as below image..
Delete Sample Folder. Clean and Build. Will work like a charm.

iOS Static Library Xcode (linking errors)

I created a static library with Xcode I have compiled selecting a device.
I added this to my library test project in Xcode 4.6
but I always have 2 errors during the linking...
I followed this tutorial: Static Library iOS Tutorial
if I download the sample code I have the same errors:
ld: warning: ignoring file /Users/Downloads/ICodeBlogStaticLibrarySample/MathTest/Classes/iCodeBlogsMathLibrary/libICodeMathUtils.a, missing required architecture i386 in file /Users/Downloads/ICodeBlogStaticLibrarySample/MathTest/Classes/iCodeBlogsMathLibrary/libICodeMathUtils.a (2 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MathFunctions", referenced from:
objc-class-ref in MathTestAppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I had once made a static lirary , I had the same problem .
Solution was to "Run the app on device " not on simulator , it works fine then !!!
Hope this helps...
I followed this step by step tutorial:
Tutorial
in particular I had to add these flags: -ObjC and -all_load
You must have selected iOS simulator while building the project. Select iOS device and it should be fine.
Do read and try to understand the error message, it's a meaningful English phrase.
symbol(s) not found for architecture i386
So there's no compiled code for the i386 architecture in the library. This means that either it's compiled for ARM only (for actual iOS devices, like iPhone or iPad), or for the 64-bit simulator (x86_64). Use otool to find out the architectures present in the library.

error when including my static library in an iOS project

I'm trying to include a static library in an iOS project.
I imported the .a file and every .h related but then I'm getting this error :
ld: warning: ignoring file /Users/alexis/Library/Developer/Xcode/DerivedData/PlazappPartnerWorkspace- cdrmloavlcqouugawmtqywiinqne/Build/Products/Debug-iphoneos/libPlazappPartnerLib.a, file was built for archive which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_LauncherViewController", 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 guess there's a problem of architecture type but I don't understand why nor how to solve it.
Can someone explain it to me and tell me how to solve it? Thanks!
It seems your library was built to run in the device (arm architecture) and you try to use it in the simulator (i386 architecture). Check your library build settings. They should match with your project build settings.
Or even better, create a fat library for development purposes. lipo command is your friend.
To verify the current architectures present in your library: (in Terminal)
cd <path to library folder> # in you case: /Users/alexis/Library/Developer/Xcode/DerivedData/PlazappPartnerWorkspace- cdrmloavlcqouugawmtqywiinqne/Build/Products/Debug-iphoneos
lipo -info libPlazappPartnerLib.a
The output should look like:
Architectures in the fat file: libPlazappPartnerLib.a are: armv6 armv7
They should match with the target device or simulator you are building for.

Resources