Kompilieren Beim Versuch, Google Analytics zu installieren und zu meinem iOS 5-Projekt kompiliert, erhalte ich die folgende Fehlermeldung:Probleme, wenn iOS 5 App mit Google Analytics/GANTracker
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_GANTracker", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
und der Code wird nicht kompiliert. Mein Build-Ziel ist iOS 5, ich bin die Verknüpfung der folgenden Bibliotheken:
- libsqlite3.dylib
- libz.dylib
- libGoogleAnalytics.a
- CFNetwork
- und GANTracker.h
und Putting:
#import "GANTracker.h"
#define kGANAccountId @"UA-XXXXXXX-X"
static const NSInteger kGANDispatchPeriodSec = 10;
@implementation AppDelegate
@synthesize window = _window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[GANTracker sharedTracker] startTrackerWithAccountID:kGANAccountId
dispatchPeriod:kGANDispatchPeriodSec
delegate:nil];
NSError *error;
if (![[GANTracker sharedTracker] setCustomVariableAtIndex:1
name:@"iPhone1"
value:@"iv1"
withError:&error]) {
// Handle error here
}
if (![[GANTracker sharedTracker] trackEvent:@"my_category"
action:@"my_action"
label:@"my_label"
value:-1
withError:&error]) {
// Handle error here
}
if (![[GANTracker sharedTracker] trackPageview:@"/app_entry_point"
withError:&error]) {
// Handle error here
}
Alle folgte ich alles in haben: http://code.google.com/mobile/articles/analytics_end_to_end.html
Fehle ich eine Bibliothek oder ein Framework? Ich benutze Xcode Version 4.3.1
Haben Sie CFNetwork Framework hinzugefügt? – malinois
Ja, editierter Beitrag. – dvdfrddsgn
richtige Antwort gepostet hier: [http://stackoverflow.com/questions/9863336/error-message-when-linking-google-analytics-to-ios-app/10099445#10099445][1] [1]: http://stackoverflow.com/questions/9863336/error-message-when-linking-google-analytics-to-ios-app/10099445#10099445 – dvdfrddsgn