Undefined symbols for architecture x86_64 in iOS Framework - ios

I tried to modified some settings to generate AsyncNetwork iOS framework.
(you can find the original AsyncNetwork from https://github.com/jdiehl/async-network)
But I got the following warning and error when using this framework I generated for iOS in my project:
ld: warning: ignoring file /MyProjectName/AsyncNetwork.framework/AsyncNetwork, missing required architecture x86_64 in file /MyProjectName/AsyncNetwork.framework/AsyncNetwork (2 slices)
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_AsyncClient", 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)
Any suggestion? I am testing whether AsyncNetwork (based on another great library, CocoaAsyncSocket) can perform better than MCSession in data transmission.
Thank you for precious time on my question.

You have to make a lipo to include some slices in same the .a.
There is an exemple:
lipo -create -output lib_name.a lib_name_device.a lib_name_simulator.a
You can find a tutorial here: https://www.raywenderlich.com/41377/creating-a-static-library-in-ios-tutorial

Related

Undefined symbols for architecture x86_64 MaxstSDK

When adding the SDK i get this compile error
ld: warning: ignoring file /Path/To/Project/MaxstVideoFramework.framework/MaxstVideoFramework, missing required architecture x86_64 in file /Path/To/Project/MaxstVideoFramework.framework/MaxstVideoFramework (2 slices)
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_MasCameraDevice", referenced from:
objc-class-ref in ScanForCouponsViewController.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 am using swift.
Does any have an idea on how to fix this ?
Thanks
Try in this terminal this code:
lipo -info /path/to/your/framework/binaryfile
Maybe the framework doesn't support architecture x86_64.
Also you should read the SDK documents, maybe you missed some settings just like "Other linker Flags".

Undefined symbols for architecture x86_64 Xcode

I added a SDK manually into my swift project that was wrote in obj-c and I create bridging header for the header file of it.
I can use all functions and classes defined in SDK and Xcode knows them (by changing their color and no errors) but when I run the project there is one error and one warning:
the issue navigator
warning:
ignoring file /Volumes/Macintosh HD/Users/arashetemad/Documents/MPosDocs/IOS/MESDK.framework/MESDK, missing required architecture x86_64 in file /Volumes/Macintosh HD/Users/arashetemad/Documents/MPosDocs/IOS/MESDK.framework/MESDK (3 slices)
error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_NLBlueToothV100ConnParams", referenced from:
objc-class-ref in MPos.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If MESDK is your framework you need to add the missing architecture in the build settings of MESDK project (supported architectures) to support it
If it's not yours, you need to ask from the developer to do it...

custom framework giving error when included file was built for x86_64 which is not the architecture being linked

I have a custom framework that I created named CCServices. When I try to implement it into my project, Setec, I get the following warnings.
ld: warning: ignoring file /Users/lindsey.vastola/Desktop/Setec/iOS/Setec/Setec/Frameworks/CCServices.framework/CCServices, file was built for x86_64 which is not the architecture being linked (arm64): /Users/lindsey.vastola/Desktop/Setec/iOS/Setec/Setec/Frameworks/CCServices.framework/CCServices
ld: warning: ignoring file /Users/lindsey.vastola/Desktop/Setec/iOS/Setec/Setec/Frameworks/CCSocket.framework/CCSocket, missing required architecture arm64 in file /Users/lindsey.vastola/Desktop/Setec/iOS/Setec/Setec/Frameworks/CCSocket.framework/CCSocket (2 slices)
Then I get the following errors when I reference some controllers in the framework.
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_Conversation", referenced from:
type metadata accessor for __ObjC.Conversation in CaptionsViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How do I get rid of these? I have tried different solutions but nothing worked. Please note that CCSocket is written in Objective C and Setec is in Swift.
the framework was missing in the link binary with libraries list.

TI SmartConfig Framework not working in iOS Simulator

I used TI smartConfig Framework in my APP to Configure CC3000 Modules.The Code downloaded from Texas Instruments Site was not working in Simulator and Showing the following error, but it's working when Device connected.
ld: warning: ignoring file /Naresh/CC3000_Smartconfig_iOS_Source-1.1/src/CC3x/libFTC_DEBUG_ARM_64.a, missing required architecture i386 in file /Naresh/CC3000_Smartconfig_iOS_Source-1.1/src/CC3x/libFTC_DEBUG_ARM_64.a (2 slices)
ld: warning: ignoring file/Naresh/CC3000_Smartconfig_iOS_Source-1.1/src/CC3x/libFTC_RELEASE_ARM_64.a, missing required architecture i386 in file /Naresh/CC3000_Smartconfig_iOS_Source-1.1/src/CC3x/libFTC_RELEASE_ARM_64.a (2 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_FirstTimeConfig", referenced from:
objc-class-ref in CC3xUtility.o
objc-class-ref in CC3xMainViewController.o
objc-class-ref in CC3xMainViewController_iPad.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
According to this post, it does not work on Simulator because you need real hardware to test its functionality. However, apparently they think that apps using this library don't have any other function/UI to test in simulator. That's why they don't provide universal library.

Undefined symbols for architecture i386 and symbol not found for architecture i386

I am developing a fake static framework. I build it and included it another sample application. The sample application is running fine on iPhone(ios 7.1), but it giving below errors when i run it on simulator
ld: warning: ignoring file /Users/awsuser8/Desktop/Test.framework/Test, file was built for archive which is not the architecture being linked (i386): /Users/awsuser8/Desktop/Test.framework/Test
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_Test", 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)
You can rebuild the library for the iOS Simulator and combine it using lipo with the ARM build of the library. Then the library will support x86 builds as well.

Resources