Error : Undefined symbols for architecture - ios

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.

Related

Undefined symbols for architecture x86_64: for libTYCommonLib.a

ld: warning: ignoring file /Users/CNS/Downloads/Demo Source Code 2/iOS/TYCommonLic_Demo/TYCommonLic_Demo/libTYCommonLib.a, missing required architecture x86_64 in file /Users/CNS/Downloads/Demo Source Code 2/iOS/TYCommonLic_Demo/TYCommonLic_Demo/libTYCommonLib.a (2 slices)
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_SalesSlipModel", referenced from:
objc-class-ref in ViewController.o
"_OBJC_CLASS_$_TYSwiperController", 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)
getting this error. please help how to resolve it?
You need to link m file :
Finally found the answer. In your target settings, locate build phases and navigate to compile sources. Once there just ad the .m file that is getting the error to the list.

Undefined symbols for architecture armv7: "_OBJC_CLASS_$_MPMusicPlayerController"

Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_MPMusicPlayerController", referenced from:
objc-class-ref in liblibPDRCore.a(PGDeviceStatus.o)
ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)
One of my lib was manually dragged into project before now I have it installed by cocoapods ,then the problem occurred. And I tried add the MediaPlayer.framework(although I don't need this framework before) to my project,the problem becomes this : ld: 14 duplicate symbols for architecture armv7
Anyone can help me 🙏?
I had same problem, but then I added MediaPlayer.framework like this

Trouble creating archive for project with my static library

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.

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)

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