Adding Testflight SDK: missing required architecture arm64 in file libTestFlight.a - ios

I'm adding the Testflight SDK to my iOS project, but now I can't build the IPA for it.
The error I have is
ld: warning: ignoring file /Users/RM/Dropbox/SAM_iOS/mainApp/SAM/TestFlightSDK2/libTestFlight.a, missing required architecture arm64 in file /Users/RM/Dropbox/SAM_iOS/mainApp/SAM/TestFlightSDK2/libTestFlight.a (3 slices)
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_TestFlight", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've followed (three times) the steps detailed here, but the error keeps appearing.
Any help is appreciated!

The 2.0.2 version of the TestFlight library does not support arm64.
You can either remove the arm64 from your project and targets or use the 2.1 beta library which has support for arm64

You can check which architectures are included in the a library using the lipo tool in Terminal:
lipo -info <path to library>
Running this on version 2.0.2 of the library, shows that it does not include the arm64 architecture:
Architectures in the fat file: libTestFlight.a are: armv7 armv7s i386
Running the same on the 2.1.3 beta:
Architectures in the fat file: libTestFlight.a are: armv7 armv7s i386 x86_64 arm64

Related

ld: symbol(s) not found for architecture x86_64 Xcode 10.3

I am trying to run a project with objective C and with a private SDK
and I get the error
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_DetectionSDK", referenced from:
objc-class-ref in ViewController.o
objc-class-ref in AppDelegate.o
objc-class-ref in SecondViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Is weird (for me) because in the real iphone runs (and in xcode 11), but in the simulator does not
Looks like your private SDK doesn't contains simulator slices.
To check this, run command lipo -i path\to\your_private_sdk\your_private_sdk.
Output should contains something like i386 x86_64 armv7 arm64
% lipo -i your_private_sdk
Architectures in the fat file: your_private_sdk are: i386 x86_64 armv7 arm64
If it contains only armv7 arm64 architectures, you need to create universal framework from your private SDK.
More details you can find here:
How to create universal (fat) library
You can try -
1:) delete the app from simulator , clean and build again.
2:) try to reinstall that private sdk & then .clean and build.

missing file require architecture i386 and x86_64 on simulator but working fine on device

I have added TurnOutNow library which contain EASDK.h and libEventAnalytics.a
My project & TurnOutNow library have reachability.m file.
So it was giving following errror on build :
duplicate symbol _OBJC_METACLASS_$_Reachability in: /Users/achavan/Library/Developer/Xcode/DerivedData/Meeting_Caddie-bbzedidjjyellubhnftrohiumzog/Build/Intermediates/Meeting Caddie.build/Debug-iphoneos/Meeting Caddie.build/Objects-normal/armv7/Reachability.o /Work_Theme_iPhone/New M_Caddie/Eventpedia_Beta/iOS_Eventpedia/TurnOutNow_SDK/libEventAnalytics.a(Reachability.o) ld: 2 duplicate symbols for architecture armv7
I searched on stackoverflow and found that removing reachability.m from build phases would work.
But then it was giving following error:
(null): "_kReachabilityChangedNotification", referenced from:
(null): -[AppDelegate setUpRechability] in AppDelegate.o
(null): +[ASIHTTPRequest registerForNetworkReachabilityNotifications] in ASIHTTPRequest.o
(null): +[ASIHTTPRequest unsubscribeFromNetworkReachabilityNotifications] in ASIHTTPRequest.o
(null): Symbol(s) not found for architecture arm64
(null): Linker command failed with exit code 1 (use -v to see invocation)
To solve this issue:
I renamed reachability class.
It is working fine on the device.
But it's giving the following error when I build on IOS simulator.
1. ld: warning: ignoring file /Work_Theme_iPhone/New M_Caddie/MeetingCaddie/iOS_Eventpedia/TurnOutNow_SDK/libEventAnalytics.a, missing required architecture i386 in file /Work_Theme_iPhone/New M_Caddie/MeetingCaddie/iOS_Eventpedia/TurnOutNow_SDK/libEventAnalytics.a (2 slices)
"_OBJC_CLASS_$_EASDK", referenced from:
2. (null): Ignoring file /Work_Theme_iPhone/New M_Caddie/MeetingCaddie/iOS_Eventpedia/TurnOutNow_SDK/libEventAnalytics.a, missing required architecture x86_64 in file /Work_Theme_iPhone/New M_Caddie/MeetingCaddie/iOS_Eventpedia/TurnOutNow_SDK/libEventAnalytics.a (2 slices)
(null): "_OBJC_CLASS_$_EASDK", referenced from:
EASDK is a file in TurnoutNow library.
Any help appreciated.
After going to several of link, I found that
i386 = ios simulator or 32 bit build on mac os x
armv6 armv7 arm7s = ios device
x86_64 = 64 bit build on mac os x
and when I ran following command :
libEventAnalytics.a (for architecture cputype (16777228) cpusubtype (0)): current ar archive random library
Amits-Mac-mini:TurnOutNow_SDK achavan$ lipo -info libEventAnalytics.a
Architectures in the fat file: libEventAnalytics.a are: armv7 arm64
I found that libEventAnalytics.a is not built for i386 and x86_64.
So I am unable to run my app on simulator.

ios static library Undefined symbols for architecture x86_64

lipo -info libXxxx.a
Architectures in the fat file: libXxxx.a are: armv7 i386 arm64
But compiler in the dependant project is giving linking error,
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_ClassXXXX", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Am I missing something?
All the lib project's target have Architectures: Standard Architectures (armv7, arm64)
and Valid Architectures arm64, armv7, armv7s
in my lipo command while making universal binary I am lipo-ing both from iphonesimulator and iphoneos folder.
Your main clue is that it says "symbol(s) not found for architecture x86_64" instead of "symbol(s) not found for architecture i386".
The fix is to tweak your build settings to allow a 32-bit build.
1) Select your project file in the Project Navigator (the left sidebar)
2) Select your project's target (first entry under TARGETS in the panel that just came up)
3) Find the "Architectures" setting (make sure "All" is selected if you can't find "Architectures")
4) Change it from "Standard Architectures" to "Universal" (or explicitly "32-bit" if you prefer)
You should be able to build after doing this.
You need to create a universal binary including following architectures in your static library project. The architectures should be including 64-bit, armv7, armv7s, arm64.
Now when you do a lipo -info anyStaticLibrary.a on terminal - you should see armv7 armv7s i386 x86_64 arm64 architectures for your fat binary.
Also note that the project which uses the above static library can work fine with the default settings of the architectures.

Undefined symbols for architecture x86_64 while using a static library

I created a static library (XXX.a) (which has 3 static libraries inside(aaa.a, bbb.a, ccc.a)) and added it into a pre-developed project (someonesProject). When I lipo -info to XXX.a I see the following architectures: armv7, i386, x86_64, arm64
When I try to run this project, I receive an error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_aaa", referenced from:
objc-class-ref in XXX.a(XXX.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
When I remove arm64 from the valid-architectures (arm64, armv7 armv7s) of the project (someonesProject), then I can run the app.
How can I fix this issue, I want to make this project work without removing arm64?
I really need help.
Thanks
E.
All your static libraries have to be compatible with arm64 if you want to compile your project with this architecture.
So I guess at least one of aaa.a, bbb.a and ccc.a is not compatible with arm64.

xcode 6 - symbols not found for architecture i386 (zbar)

I have a project which uses the zbar-sdk (a barcode scanning library).
After updating my machine to xcode 6 I am having some trouble.
Please help me solve this.
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ZBarReaderViewController", referenced from:
objc-class-ref in MenuListViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
you have to import AVFoundation and AudioToolbox frameworks and also set i386 armv6 armv7 armv7s architectures needed for running the libraries

Resources