I've added GAI framework.
Files :
- GAI.h
- GAIDictionaryBuilder.h
- GAIFields.h GAILogger.h
- GAITrackedViewController.h
- GAITracker.h
- libGoogleAnalytics_debug.a
But when I'm trying to build the project, it shows such error:
Undefined symbols for architecture i386:
"_llvm_gcda_emit_arcs", referenced from:
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAI.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIUncaughtExceptionHandler.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIBatchingDispatcher.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDataStore.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDefaultLogger.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIStringUtil.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAITrackerImpl.o)
...
"_llvm_gcda_emit_function", referenced from:
___llvm_gcov_writeout in ...
"_llvm_gcda_end_file", referenced from:
___llvm_gcov_writeout in ...
"_llvm_gcda_increment_indirect_counter", referenced from:
-[GAI defaultTracker] in libGoogleAnalytics_debug.a(GAI.o)
-[GAI setDefaultTracker:] in libGoogleAnalytics_debug.a(GAI.o)
...
"_llvm_gcda_start_file", referenced from:
___llvm_gcov_writeout in ...
ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
What caused this error?
Update :
// AppDelegate.h
@property (nonatomic, retain) id<GAITracker> tracker;
// AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[GAI sharedInstance].optOut = YES;
[GAI sharedInstance].dispatchInterval = 120;
[GAI sharedInstance].trackUncaughtExceptions = YES;
self.tracker = [[GAI sharedInstance] trackerWithName: kTrackerName
trackingId: kTrackingId];
//other code
return YES;
}
Stay organized with collections Save and categorize content based on your preferences. Use our iOS sample app to see how Analytics works, or add Analytics to your existing app.
I Had the same error : Just add "libGoogleAnalyticsServices.a" into your files like this :
I hope this can help you. It's work for me ;)
++
In addition to all the libraries and frameworks specified in the README file, turns out that you need to include the AdSupport.framework and libGoogleAnalyticsServices.a (instead of the libGoogleAnalytics_debug.a) to get rid of the build errors while compiling for simulator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With