Google Analytics linker error without AdSupport.framework - ios

I'm trying to build my iOS project which includes Google Analytics 3.03a. I've followed all the instructions about using the -force_load linker flags, but unless I include the AdSupport framework I always end up getting this error message when doing my debug build:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ASIdentifierManager", referenced from:
objc-class-ref in libGoogleAnalyticsServices.a(TAGAdvertiserId.o)
objc-class-ref in libGoogleAnalyticsServices.a(TAGAdvertisingTrackingEnabledMacro.o)
objc-class-ref in libGoogleAnalyticsServices.a(TAGMobileAdwordsUniqueIdMacro.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If I try it for my release build I get the same error but for the armv7 architecture.
Everything I'm reading tells me that if I do include the AdSupport framework then my app will get rejected, since I'm not serving ads, so I'm at a loss to know what to do.
This happens both with my actual project, and with a totally new blank test project that literally has no other linker flags:
OTHER_LDFLAGS = -force_load ${PROJECT_DIR}/GoogleAnalytics/libGoogleAnalyticsServices.a
I'm not using the Tag Manager at all, as far as I know.

Add the framework as optional. I submitted apps with Google Analytics without problems.

Related

MLKit iOS: Undefined symbols for architecture armv7

I have been trying to integrate MLKit into CardIO using cocoapod. I fixed all the warnings by cocoapod and CardIO was built successfully. However, when I link CardIO to my app and build, this error comes out. I searched all over the internet and tried different kind of approaches suggested by people but still to no avail. Is there any step or setting I might have missed during integration/linking?
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_FIRVisionImage", referenced from:
objc-class-ref in libCardIO.a(CardIOView.o)
"_OBJC_CLASS_$_FIRVision", referenced from:
objc-class-ref in libCardIO.a(CardIOView.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I added $(inherited) in Other Linker flags, Header search paths, Framework search Paths, Library search Paths in "Target -> Build Settings" resolved the issue! Happy Coding!

Xcode Build error Undefined symbols for architecture arm64: "_OBJC_CLASS_$_GameScene"

I have activated arm7 armv7 arm64 as valid architecture for 64 bit requirement by Apple recently but when I try to build the app in Xcode it throws me this error. I get a warning first for libchartboost.a not being found, I download the chartboost latest folder from their website but it does not have libchartboost.a so I am still using chartboost 3.2.1. But not sure if thats the issue since I get an error related to GameScene below. Am I missing a framework? Thanks for your help.
ld: warning: ignoring file /Users/Administrator/Documents/Software/libChartboost.a, missing required architecture arm64 in file /Users/Administrator/Documents/Software/libChartboost.a (3 slices)
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_GameScene", referenced from:
objc-class-ref in AlertLayer.o
objc-class-ref in GameLayer.o
objc-class-ref in levelpackMenuLayer.o
objc-class-ref in LevelSelectLayer.o
objc-class-ref in timetrialMenuLayer.o
objc-class-ref in IAPHelper.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Probably an old thread, but in such linker errors, following step works:
Link all the required frameworks along with Chartboost framework, such as Storekit, Webkit, AVFoundation, Foundation etc.
These are all the frameworks that are used by Chartboost framework to fetch and display ads in media formats (audio and video).
For latest details on how to fully integrate and what all frameworks are required, refer to this guide.

Archiving fails due to undefined Symbols for Google Analytics

I have integrated GAI using the most recent cocoapods version.
When I build in the Debug config everything runs just fine.
However, as soon as I try to archive the Application the compiler fails with the following messages:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_GAIDictionaryBuilder", referenced from:
objc-class-ref in libWLCore.a(WLTrackingHelper.o)
"_OBJC_CLASS_$_GAI", referenced from:
objc-class-ref in libWLCore.a(WLTrackingHelper.o)
"_kGAIScreenName", referenced from:
+[WLTrackingHelper trackView:] in libWLCore.a(WLTrackingHelper.o)
+[WLTrackingHelper resetView] in libWLCore.a(WLTrackingHelper.o)
"_kGAIAnonymizeIp", referenced from:
+[WLTrackingHelper prepareDefaultTracker:withAnonymization:withUnCaughtExceptions:withDebug:] in libWLCore.a(WLTrackingHelper.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Since it works in Debug I tried to figure out where the difference in the configuration between Debug and Release lies.
I found out that the Other linker flags in Release are empty whereas in Debug contains the flag for GoogleAnalytics and other frameworks and libraries.
After adding the flags to the Release Configuration of Other linker flags I got
library not found for -lGoogleAnalyticsServices
After that, I added libPods and after that libPods-GoogleAnalytics to the Link Binary With Libraries section but the errors remained the same.
I invested almost 2 days into that problem, but I could not find any solution.
After some fiddling I found the solution by adding not the library generated by cocoa pods (libPods-GoogleAnalytics), but directly linking the libGoogleAnalyticsServices to my main project. Still, I think this is not the most elegant solution possible since the linker should know that the symbols he was missing were available already, as provided by cocoapods.
Please confirm you have added $(inherited) to Other Linker Flags (Build Settings) as in the below image. Add the same in Release also, otherwise the same error will pop up at the time of archiving.

Undefined symbols for architecture i386:"_OBJC_CLASS_$_SBJsonParser"

I'm creating a iphone app and its contain SBJson_3.1.1 for login purpose [I'm using webservice for login data] but when I run the project it shows the following error and I cant find what its reason I'm quite new to ios development so please guide me.
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SBJsonParser", 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)
If you are building the SBJson library and have linked your app to that, you will need add the -ObjC and -all_load flags to your linker options.

Architecture issue in iOS

I'm using Reachability on my project to get the type of connection used, but an error has ocurred.
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_Reachability", referenced from:
objc-class-ref in ContributionViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I don't know what to do... my project is for iOS 4.3 and I've never had this kind of problem before.
Thx
Did you include the reachability framework in your projects linked libraries ? You can confirm by clicking on your project file on the file list and checking the build phases tab. It should be listed in the linked library section,

Resources