Trouble creating archive for project with my static library - ios

I am developing a static library for iOS, now I am testing my static library (libXYZ.a) with a test project, I am able to run it on device but when I am trying
to make archive of the test project I got some errors saying:
ld: warning: ignoring file /Users/Ravindra/Desktop/SDK Project/Static Library/XYZSDKTest/XYZSDKTest/XYZ_SDK/libXYZSDK.a, missing required architecture arm64 in file /Users/Ravindra/Desktop/SDK Project/Static Library/XYZSDKTest/XYZSDKTest/XYZ_SDK/libXYZSDK.a (2 slices)
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_XYZ", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_XYZConfiguration", 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 used the following command to build universal build:
lipo -create "libXYZSDK_simulator.a" "libXYZSDK_device.a" -output "libXYZSDK.a"
Please help me out to resolve this problem.

Related

compile error during build when initialize an object from static library

I have the following compile error when try to create and initialize an object in Data parser class. The code is
Component *component=[[Component alloc] initWithInputComObjects:inputComObjects withOutputComObjects:outputComObjects];
where initWithInputComObjects:inputComObjects:withOutputComObjects:outputComObjects is a method inside the .m file in the library
ld: warning: directory not found for option '-L/Users/admin/Desktop/KNXComfort/Pods/build/Debug-iphoneos'
ld: warning: ignoring file /Users/admin/Desktop/KNXComfort/KNXComfort/libKNXCommuncationLib.a, missing required architecture i386 in file /Users/admin/Desktop/KNXComfort/KNXComfort/libKNXCommuncationLib.a (3 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_Channel", referenced from:
objc-class-ref in DataParser.o
"_OBJC_CLASS_$_ComObject", referenced from:
objc-class-ref in DataParser.o
"_OBJC_CLASS_$_Component", referenced from:
objc-class-ref in DataParser.o
"_OBJC_CLASS_$_Device", referenced from:
objc-class-ref in DataParser.o
(maybe you meant: _OBJC_CLASS_$_DevicesCollectionViewController, _OBJC_CLASS_$_DevicesCollectionViewCell )
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Undefined symbols for architecture i386
You are trying to build for the i386 processor but the library you are trying to use wasn't built to support that architecture.
You either need to remove i386 from your build (build for a device) or rebuild the library to include support for i386.

Error : Undefined symbols for architecture

I am getting below error. It was working fine and I don't have any idea about what caused this issue.
ld: warning: ignoring file /Users/akashpatel/Developer/iOS_development/FantasyCricket/Fantasy_cricket/Library/JMC/JMCClasses/Libraries/CrashReporter.framework/CrashReporter, missing required architecture arm64 in file /Users/akashpatel/Developer/iOS_development/FantasyCricket/Fantasy_cricket/Library/JMC/JMCClasses/Libraries/CrashReporter.framework/CrashReporter (3 slices)
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_PLCrashReport", referenced from:
objc-class-ref in CrashReporter.o
"_OBJC_CLASS_$_PLCrashReporter", referenced from:
objc-class-ref in CrashReporter.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I tried removing and adding CrashReporter from and to project.
Select your project, go to Build Settings and have a look at the Architectures. You should delete arm64 from the Architectures and also from Valid Architectures and Build the app again.

iOS testflight sdk arm7 architecture issue

I have added test flight sdk to my project and after archive it I got this error:
ld: warning: ignoring file Include/libapps-on-maps-sim.a, file was built for archive which is not the architecture being linked (armv7): Include/libapps-on-maps-sim.a
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_TestFlight", referenced from:
objc-class-ref in MTAppDelegate.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How can I change architecture for this file? I have architecture settings for my project and for pods $(ARCHS_STANDARD)

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.

Apple Mach-O Linker Error With Parse

I need some assistance. I added Parse SDK and it works fine during testing. When I attempt to build it, it gives me four 'Apple Mach-O Linker' errors:
ld: warning: ignoring file
/Users/Amirhosein/Downloads/ParsePlatform-PushTutorial-63133fb/iOS/Parse.framework/Parse,
missing required architecture arm64 in file
/Users/Amirhosein/Downloads/ParsePlatform-PushTutorial-63133fb/iOS/Parse.framework/Parse
(3 slices) Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_PFPush", referenced from:
objc-class-ref in AppDelegate.o "_OBJC_CLASS_$_PFInstallation", referenced from:
objc-class-ref in AppDelegate.o "_OBJC_CLASS_$_Parse", 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)
It sounds as if your library is not built for 64-bit iOS but you're trying to use that setting for your app. Try removing arm64 from the architecture entry in your build settings.
Cleaning the code and then building again solve the problem for me!

Resources