GTMSessionFetcherService linker error when trying to build my xcode project - ios

I'm using Cocoapods to install the latest GPG and used the latest XCode 7.3 and iOS SDK 9.3 but I couldn't manage to make the build of my project and stuck with these 5 linker error which I couldn't solve :
"_OBJC_CLASS_$_GSDK_GTMSessionFetcherService", referenced from:
objc-class-ref in gpg(GIPNetworkImage.o)
objc-class-ref in libSignIn_external.a(GIDSignIn.o)
"_GSDK_kGTMSessionFetcherStatusDomain", referenced from:
-[GSDK_GTMOAuth2SignIn authCodeObtained] in libGTMOAuth2_external_external.a(GTMOAuth2SignIn.o)
"_GSDK_GTMSessionFetcherAssertValidSelector", referenced from:
-[GSDK_GTMOAuth2Authentication authorizeRequest:delegate:didFinishSelector:] in libGTMOAuth2_external_external.a(GTMOAuth2Authentication.o)
-[GSDK_GTMOAuth2SignIn initWithAuthentication:authorizationURL:delegate:webRequestSelector:finishedSelector:] in libGTMOAuth2_external_external.a(GTMOAuth2SignIn.o)
"_OBJC_CLASS_$_GSDK_GTMSessionFetcher", referenced from:
objc-class-ref in libGTMOAuth2_internal_external.a(GTMOAuth2SignInInternal.o)
objc-class-ref in libGTMOAuth2_external_external.a(GTMOAuth2Authentication.o)
objc-class-ref in libGTMOAuth2_external_external.a(GTMOAuth2SignIn.o)
objc-class-ref in gpg(GPGClearcutLogger.o)
objc-class-ref in libSignIn_external.a(GIDSignIn.o)
objc-class-ref in libSignIn_external.a(GIDRuntimeConfigFetcher.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've even tried to add GTMSessionFetcherService source in my project but can't seem to fix this. Any idea?
Thanks

I ran into a very similar build issue while trying to integrate Google Sign-In. The non-Cocoapods instructions mention adding GoogleSignIn.framework to your project, but they don't tell you that you need to link the rest of the frameworks in the sign-in SDK as well:
GoogleAppUtilities.framework
GoogleAuthUtilities.framework
GoogleNetworkingUtilities.framework
GoogleSignIn.framework
GoogleSymbolUtilities.framework
GoogleUtilities.framework

All you have to do is add GoogleOpenSource.framework from the Google+ iOS SDK to libs
then
add GoogleOpenSource to your robovm.xml
Finally make sure the GoogleSignIn robopod is present

Add libsqlite3.dylib, libz.tbd, and AddressBook.framework to "Linked Frameworks and Libraries". This solved my issue.Also I copied these frameworks too.
GoogleAppUtilities.framework
GoogleAuthUtilities.framework
GoogleNetworkingUtilities.framework
GoogleSignIn.framework
GoogleSymbolUtilities.framework
GoogleUtilities.framework

I had this same issue for Xamarin.iOS.
To solve, I simply updated my Xamarin.Google.iOS.SignIn package to the latest version (4.0.1.1) and updated Xamarin.Build.Download to latests (0.4.2).
Updating these two packages caused extra packages to be added to my project. I believe it's these extra packages that fixed the native linker errors I was getting (same exact errors as Yanuar Tanil).

Related

MSAL iOS build with Carthage - linker error

I'm following the instructions here (https://github.com/AzureAD/microsoft-authentication-library-for-objc) to add the MSAL library to my (new) project. I'm using Xcode 10.1. I have a Cartfile with just one entry for MSAL. When running Carthage update --platform iOS I get a linker error (lots of them actually):
Undefined symbols for architecture armv7s:
"_MSID_DEFAULT_FAMILY_ID", referenced from:
-[MSALAccountsProvider accountForHomeAccountId:error:] in MSALAccountsProvider.o
-[MSALAccountsProvider accountForUsername:error:] in MSALAccountsProvider.o
-[MSALAccountsProvider allAccountsForAuthority:error:] in MSALAccountsProvider.o
"_OBJC_CLASS_$_MSIDConfiguration", referenced from:
objc-class-ref in MSALAccountsProvider.o
"_OBJC_CLASS_$_MSIDTelemetryBaseEvent", referenced from:
_OBJC_CLASS_$_MSALTelemetryDefaultEvent in MSALTelemetryDefaultEvent.o
"_OBJC_CLASS_$_MSIDAADV2IdTokenClaims", referenced from:
objc-class-ref in MSALResult.o
And so on - many such symbols.
Interesting the macOS one builds for me, even though on Github MSAL says macOS is not supported :)
Any help is greatly appreciated!

Facebook SDK is not a dylib

I am attempting to build a project I did not write, and I keep reaching this error:
ld: warning: Auto-Linking supplied '/Users/my_user_name/Documents/FacebookSDK/FBSDKCoreKit.framework/FBSDKCoreKit', framework linker option at /Users/my_user_name/Documents/FacebookSDK/FBSDKCoreKit.framework/FBSDKCoreKit is not a dylib
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FBSDKAppEvents", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_FBSDKApplicationDelegate", 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)
This is a new error since updating Parse and Bolts pods. Other solutions for Auto-Linking that I've seen on here have not been able to help, but since the update to Facebook SDK is new perhaps someone has already solved this issue.
It's because of the conflict between the reference of FB SDK located at /Users/my_user_name/Documents/ and the one in CocoaPods.
Originally I used FB SDK located at /Users/my_user_name/Documents/ as suggested in FB SDK Getting Started tutorial. Then switched to Cocoapods after I started using react-native.
The solution is to remove Facebook SDK references from your apps Frameworks folder in YourApp.xcodeproj. I have explained more at https://stackoverflow.com/a/36947791/556678.
Make sure you're using a current version of the FBSDK! Also make sure you followed THESE (new) instructions: https://parse.com/docs/ios/guide#users-facebook-users (because with the parse update different things must be done!).
If the problem persists, I suggest you build a new project (that follows the instructions in the previous link).

google admob undefined symbol for architecture armv7

i have replaced older version of admob 6.6.1 with latest admob library version 6.12.0 but i get this error although every thing is fine. I am using xcode 6.0.1, how to resolve this issue, any help?
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_EKEvent", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
"_OBJC_CLASS_$_EKEventEditViewController", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I had same issue but i solved by adding eventKit and eventUIKit framework into my project. Hope it will work for you too.
This error is mostly because update of your ADMOB SDK.
1) Go to build phases->Open list of frameworks.
2) Locate libGoogleAdMobAds.a. Remove this file by pressing - sign.
3) Again add this libGoogleAdMobAds.a file back by pressing + sign and selecting "Add other". select this file from ADMOB folder of your project.
4) Clean, then build and run your project.
Also, check you have -ObjC set to Other Linker Flags in your project's target build settings and required frameworks are added.
add Framework EventKit and EventKitUI.

Building Sinch from CocoaPods

Has any tried building the latest Sinch (sinch.com) SDK through Cocoapods? Version 3.0.0.
I'm getting the following:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SINOutgoingMessage", referenced from:
objc-class-ref in MessageThreadViewController.o
"_OBJC_CLASS_$_Sinch", referenced from:
objc-class-ref in SinchClient.o
(maybe you meant: _OBJC_CLASS_$_SinchClient)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And wondering if anyone knows the fix?
Thanks!
Charlie
Update, we have now released arm64 build so for new projects you should not have to change archs anymore.
Update you pods build settings and you should be fine.
Christan
You do not have to do the things belove anymore. It is fixed by Sinch. Check the cjensen's answer.
In here there is an official tutorail from Sinch and it says
Try removing i386 from Architectures and run again.

Objective C - Apple Mach - O Linker Error

I'm using social sharing phonegap plugin for my mobile app project. I got this problem when build the project. I got a several of error. I'm using this phonegap plugin for my social sharing function. Check https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.
Undefined symbols for architecture armv7s:
"_SLServiceTypeTwitter", referenced from:
-[SocialSharing shareViaTwitter:] in SocialSharing.o
"_OBJC_CLASS_$_MFMessageComposeViewController", referenced from:
objc-class-ref in SocialSharing.o
"_SLServiceTypeFacebook", referenced from:
-[SocialSharing shareViaFacebook:] in SocialSharing.o
"_OBJC_CLASS_$_SLComposeViewController", referenced from:
objc-class-ref in SocialSharing.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Why?
Add the frame works by using the following steps:
In the project navigator, select your project
Select your target
Select the 'Build Phases' tab
Open 'Link Binaries With Libraries' expander
Click the '+' button
Select framework (MessageUI.framework and Social.framework in your case)
I had the same issue as well, and I followed the steps mentioned here:
https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/issues/116
So, basically I remove the platform:
cordova platform remove ios
Then add it back:
cordova platform add ios
Hope it helps!

Resources