Undefined symbols for architecture x86_64 AFNetworking with Cocoapods - ios

Can anybody help me with this, its driving me crazy. I looked at every post I could find with a similar issue, and none of it worked.
I installed AFNetworking 3.0 in my project with Cocoapods, it installed, I see the AFNetworking pod in my project.Set built Architure only :YES Whenever I try to build I get the following error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_AFHTTPSessionManager", referenced from:
objc-class-ref in EFServer.o
"_OBJC_CLASS_$_AFJSONRequestSerializer", referenced from:
objc-class-ref in EFServer.o
"_OBJC_CLASS_$_AFJSONResponseSerializer", referenced from:
objc-class-ref in EFServer.o
"_OBJC_CLASS_$_MBProgressHUD", referenced from:
objc-class-ref in EFServer.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 had the same problem after installing pods to my old project. In my case there where custom linker flags added to the Build Settings of the target, but the $(inherited) was removed so the pods flags were missing (not inherited) therefore no AFNetworking framework were linked.
I suggest to check out is there a $(inherited) row added to the Other Linker Flags section of Build Settings for the target.

Just delete the DerivedData folder and re-try.
rm -rf ~/Library/Developer/Xcode/DerivedData

add below lines to your podfile and reinstall it and add your project name to target.
target 'your project name' do
use_frameworks!
pod 'AFNetworking', '~> 3.0'
end
hope your problem will be solved.

Related

FirebaseCrashlytics and FirebaseAnalytics pod installation is failing

In migrating my Fabric/Crashlytics SDK into FirebaseCrashlytics, I've decided to integrate cocoapods.
After adding FirebaseCrashlytics and FirebaseAnalytics into the Podfile, I am getting this error when I compile and I can't figure out why it is happening:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_GSDK_GTMLogger", referenced from:
objc-class-ref in GoogleIPhoneUtilities(GIPReachability.o)
"_kFirebaseCloudMessagingErrorDomain", referenced from:
-[FIRMessaging(FIRApp) configureMessaging:] in FirebaseMessaging(FIRMessaging+FIRApp_ed2c92d2ac2b5969ab6c5684759ab5bd.o)
-[FIRMessaging(FIRApp) exitApp:withError:] in FirebaseMessaging(FIRMessaging+FIRApp_ed2c92d2ac2b5969ab6c5684759ab5bd.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What am I missing?
EDIT: - I've fixed the second issue with FirebaseMessaging, for the life of me, I can't figure out why I'm having issues with this:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_GSDK_GTMLogger", referenced from:
objc-class-ref in GoogleIPhoneUtilities(GIPReachability.o)
All of the Firebase Repos I'm using are currently now set up via Cocoapods.
It looks like the app is linking a very old copy of FirebaseMessaging and some of its dependencies with recent versions of Analytics and Crashlytics.
Since Firebase libraries share dependencies, it is not likely to work to mix incompatible versions or installation methods.
Something with linking... Looks like the wrong podfile configuration. Make sure that you add target pods to the needed App target correctly.

XCODE, building for iOS - undefined symbols for architecture armv7

looks like I am not the first, who is asking about this issue but I need to try. Does anybody encountered this problem?
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_GSDK_GTMSessionFetcher", referenced from:
objc-class-ref in gpg(GPGClearcutLogger.o)
"_OBJC_CLASS_$_GSDK_GTMSessionFetcherService", referenced from:
objc-class-ref in gpg(GIPNetworkImage.o)
"_GTMMethodCheckMethodChecker", referenced from:
+[NSDictionary(GTMNSDictionaryURLArgumentsAdditions) xxGTMMethodCheckMethodNSString32] in libGoogleToolboxForMac.a(GTMNSDictionary+URLArguments.o)
+[NSDictionary(GTMNSDictionaryURLArgumentsAdditions) xxGTMMethodCheckMethodNSString33] in libGoogleToolboxForMac.a(GTMNSDictionary+URLArguments.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It looks like, some Google Play dependency is causing it, if I got it right. I tried to switch some values in XCODE recommended in other threads with similar issue. Namely build settings -> architectures, valid architectures, supported platforms, base sdk, active architecture only. Also no changes, still the same error during linking. cocoapods are installed
I use XCODe 8.1.
Any suggestions?
I managed to solve it by myself. The key is to edit the pod file like this (tested with the unity 5.3.6f1, GPG games plugin 0.9.34 and xcode 8.1):
platform :ios, '8.0'
target 'Unity-iPhone' do
pod 'GooglePlayGames', '5.1'
end
then you need to run pod install and it works!

Stuck at integrating worldpay using cocoapods

I am integrating worldpay using cocoapods into my project but am getting these errors:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_AFHTTPRequestOperation", referenced from:
objc-class-ref in libWorldpay.a(Worldpay.o)
objc-class-ref in libWorldpay.a(ThreeDSController.o)
objc-class-ref in libWorldpay.a(APMController.o) "_OBJC_CLASS_$_AFHTTPRequestOperationManager", referenced from:
objc-class-ref in libWorldpay.a(WorldpayUtils.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed
with exit code 1 (use -v to see invocation)
Would anyone help me solve this issue?
Thanks.
_AFHTTPRequestOperation and _AFHTTPRequestOperationManager are AFNetworking classes. I think you may also need to add the AFNetworking pod.
platform :ios, '7.0'
pod "AFNetworking", "~> 2.0"
Need to add to implement this effectively since worldpay is dependent on AFNetworking
https://github.com/Worldpay/worldpay-lib-ios

XCode linker error after migrating to Cocoa Pods

The problem
I'm pretty new when it comes to iOS development and XCode, so please comment and let me know if any details are missing from the question.
We have migrated an SDK from downloadable archive files to Cocoa Pods. One of our partners tried using our Pod, but the XCode linker gave the following error:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_TAGContainerOpener", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_TAGManager", referenced from:
objc-class-ref in AppDelegate.o
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The Pod file in the project is:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
target 'Demo' do
pod 'GoogleAppIndexing'
pod 'GoogleMaps'
pod 'OurPod', :git => 'https://github.com/AcmeCorp/OurPod.git'
end
target 'DemoTests' do
end
Other settings
We are opening the xcworkspace file (not the xcode.proj file).
What have I tried
I have tried to search the error but found nothing relevant.
Any idea what should I be looking for?
Thanks in advance!
Met with the same problem while trying to add Google Tag Manager and GoogleAnalytics to my app
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_TAGContainerOpener", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_TAGManager", referenced from:
objc-class-ref in ViewController.o
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)
I think you have missed some library.
Try adding libGoogleAnalyticsServices.a to your project.
This had fixed my compilation error

"Undefined symbols for architecture x86_64:" Error with Branch.io

I'm attempting to use the Branch.io iOS SDK in my iOS app, and I'm getting the following error when I try to compile:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_CSSearchableIndex", referenced from:
objc-class-ref in BranchCSSearchableItemAttributeSet.o "_OBJC_CLASS_$_CSSearchableItem", referenced from:
objc-class-ref in BranchCSSearchableItemAttributeSet.o "_OBJC_CLASS_$_CSSearchableItemAttributeSet", referenced from:
_OBJC_CLASS_$_BranchCSSearchableItemAttributeSet in BranchCSSearchableItemAttributeSet.o
"_OBJC_METACLASS_$_CSSearchableItemAttributeSet", referenced from:
_OBJC_METACLASS_$_BranchCSSearchableItemAttributeSet in BranchCSSearchableItemAttributeSet.o ld: symbol(s) not found for
architecture x86_64 clang: error: linker command failed with exit code
1 (use -v to see invocation)
As the tutorial described, I have the Branch-SDK folder correctly added to the project, I configured the PLST, and added all the code in the AppDelegate.m. I skipped step 3 for enabling universal links, because I won't need that yet.
What am I missing that could be causing this? For this sort of error with other frameworks, it tends to be caused by incorrect declaration of the class, but I don't see where I'm doing that incorrectly.
For me within the Podfile uncommenting the following line and rerunning the installation resolved this kind of issues in XCode:
use_frameworks!
And do a
pod install
And try cleaning and running the app in XCode once again and it should work.
It worked for me.

Resources