2010-06-27 10 views
6

Kısa bir süre önce iOS4 SDK sürümüne geçtim ve uygulamam artık simülatör için derleme yapmıyor, ancak cihaz için derlemesini yapıyor. Bu, 3. taraf kitaplığı libGoogleAnalytics.a nedeniyle oluşur. Çözüm, yeni SDK ile uyumlu yeni bir statik kütüphanenin yayınlanması için google'a benziyor, ne yazık ki herhangi bir yayınlanma tarihi söz konusu değil ve yeni SDK lisansı nedeniyle yeni bir kütüphane yayınlayamayacaklar.libGoogleAnalytics.a iPhone iOS4 Simulator ile ilgili sorunları bağlama

http://www.google.com/support/forum/p/Google+Analytics/thread?tid=0e35876711dc99b1&hl=en

ben derlemek aşağıdaki hataları alıyorum: google forumunda

Undefined symbols: 
    ".objc_class_name_NSObject", referenced from: 
     .objc_class_name_GANTCPSocket in libGoogleAnalytics.a(GANTCPSocket.o) 
     .objc_class_name_GTMLogger in libGoogleAnalytics.a(GTMLogger.o) 
     .objc_class_name_GTMLogBasicFormatter in libGoogleAnalytics.a(GTMLogger.o) 
     .objc_class_name_GTMLogLevelFilter in libGoogleAnalytics.a(GTMLogger.o) 
     .objc_class_name_GTMLogNoFilter in libGoogleAnalytics.a(GTMLogger.o) 
     .objc_class_name_GTMLogASLWriter in libGoogleAnalytics.a(GTMLogger+ASL.o) 
     .objc_class_name_GTMLoggerASLClient in libGoogleAnalytics.a(GTMLogger+ASL.o) 
     .objc_class_name_GANDataDispatcher in libGoogleAnalytics.a(GANDataDispatcher.o) 
     .objc_class_name_GANHTTPResponseParser in libGoogleAnalytics.a(GANHTTPResponseParser.o) 
     .objc_class_name_GANEvent in libGoogleAnalytics.a(GANEvent.o) 
     .objc_class_name_GTMLoggerRingBufferWriter in libGoogleAnalytics.a(GTMLoggerRingBufferWriter.o) 
     .objc_class_name_GANTracker in libGoogleAnalytics.a(GANTracker.o) 
     .objc_class_name_GANPersistentEventStore in libGoogleAnalytics.a(GANPersistentEventStore.o) 
    ".objc_class_name_NSFileManager", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GANPersistentEventStore.o) 
    ".objc_class_name_NSString", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GTMLogger.o) 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GANTracker.o) 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GANPersistentEventStore.o) 
    ".objc_class_name_NSError", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GANTracker.o) 
     literal[email protected][email protected][email protected] in libGoogleAnalytics.a(GANPersistentEventStore.o) 
    ".objc_class_name_NSFileHandle", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GTMLogger.o) 
    ".objc_class_name_NSMutableString", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GANDataDispatcher.o) 
    ".objc_class_name_NSTimer", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GANTracker.o) 
    ".objc_class_name_NSMutableArray", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GANDataDispatcher.o) 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GANPersistentEventStore.o) 
    ".objc_class_name_UIScreen", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GANDataDispatcher.o) 
    ".objc_class_name_NSProcessInfo", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GTMLogger.o) 
    "_objc_exception_extract", referenced from: 
     +[GTMLogger sharedLogger] in libGoogleAnalytics.a(GTMLogger.o) 
     +[GTMLogger setSharedLogger:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[GTMLogger setWriter:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[GTMLogger setFormatter:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[GTMLogger setFilter:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[NSFileHandle(GTMFileHandleLogWriter) logMessage:level:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[NSArray(GTMArrayCompositeLogWriter) logMessage:level:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[GTMLogStandardFormatter stringForFunc:withFormat:valist:level:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[GTMLoggerRingBufferWriter count] in libGoogleAnalytics.a(GTMLoggerRingBufferWriter.o) 
     -[GTMLoggerRingBufferWriter droppedLogCount] in libGoogleAnalytics.a(GTMLoggerRingBufferWriter.o) 
     -[GTMLoggerRingBufferWriter reset] in libGoogleAnalytics.a(GTMLoggerRingBufferWriter.o) 
     -[GTMLoggerRingBufferWriter dumpContents] in libGoogleAnalytics.a(GTMLoggerRingBufferWriter.o) 
     -[GTMLoggerRingBufferWriter logMessage:level:] in libGoogleAnalytics.a(GTMLoggerRingBufferWriter.o) 
     +[GANTracker sharedTracker] in libGoogleAnalytics.a(GANTracker.o) 
     +[GANTracker allocWithZone:] in libGoogleAnalytics.a(GANTracker.o) 
     -[GANTracker startTrackerWithAccountID:dispatchPeriod:delegate:] in libGoogleAnalytics.a(GANTracker.o) 
     -[GANTracker trackPageview:withError:] in libGoogleAnalytics.a(GANTracker.o) 
     -[GANTracker trackEvent:action:label:value:withError:] in libGoogleAnalytics.a(GANTracker.o) 
     -[GANTracker stopTracker] in libGoogleAnalytics.a(GANTracker.o) 
     -[GANTracker dispatch] in libGoogleAnalytics.a(GANTracker.o) 
    ".objc_class_name_NSDate", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GTMLogger.o) 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GANPersistentEventStore.o) 
    ".objc_class_name_UIDevice", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GANDataDispatcher.o) 
    "_objc_exception_try_exit", referenced from: 
     +[GTMLogger sharedLogger] in libGoogleAnalytics.a(GTMLogger.o) 
     +[GTMLogger setSharedLogger:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[GTMLogger setWriter:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[GTMLogger setFormatter:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[GTMLogger setFilter:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[NSFileHandle(GTMFileHandleLogWriter) logMessage:level:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[NSArray(GTMArrayCompositeLogWriter) logMessage:level:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[GTMLogStandardFormatter stringForFunc:withFormat:valist:level:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[GTMLoggerRingBufferWriter count] in libGoogleAnalytics.a(GTMLoggerRingBufferWriter.o) 
     -[GTMLoggerRingBufferWriter droppedLogCount] in libGoogleAnalytics.a(GTMLoggerRingBufferWriter.o) 
     -[GTMLoggerRingBufferWriter reset] in libGoogleAnalytics.a(GTMLoggerRingBufferWriter.o) 
     -[GTMLoggerRingBufferWriter dumpContents] in libGoogleAnalytics.a(GTMLoggerRingBufferWriter.o) 
     -[GTMLoggerRingBufferWriter logMessage:level:] in libGoogleAnalytics.a(GTMLoggerRingBufferWriter.o) 
     +[GANTracker sharedTracker] in libGoogleAnalytics.a(GANTracker.o) 
     +[GANTracker allocWithZone:] in libGoogleAnalytics.a(GANTracker.o) 
     -[GANTracker startTrackerWithAccountID:dispatchPeriod:delegate:] in libGoogleAnalytics.a(GANTracker.o) 
     -[GANTracker trackPageview:withError:] in libGoogleAnalytics.a(GANTracker.o) 
     -[GANTracker trackEvent:action:label:value:withError:] in libGoogleAnalytics.a(GANTracker.o) 
     -[GANTracker stopTracker] in libGoogleAnalytics.a(GANTracker.o) 
     -[GANTracker dispatch] in libGoogleAnalytics.a(GANTracker.o) 
    ".objc_class_name_NSDateFormatter", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GTMLogger.o) 
    "_objc_exception_try_enter", referenced from: 
     +[GTMLogger sharedLogger] in libGoogleAnalytics.a(GTMLogger.o) 
     +[GTMLogger setSharedLogger:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[GTMLogger setWriter:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[GTMLogger setFormatter:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[GTMLogger setFilter:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[NSFileHandle(GTMFileHandleLogWriter) logMessage:level:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[NSArray(GTMArrayCompositeLogWriter) logMessage:level:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[GTMLogStandardFormatter stringForFunc:withFormat:valist:level:] in libGoogleAnalytics.a(GTMLogger.o) 
     -[GTMLoggerRingBufferWriter count] in libGoogleAnalytics.a(GTMLoggerRingBufferWriter.o) 
     -[GTMLoggerRingBufferWriter droppedLogCount] in libGoogleAnalytics.a(GTMLoggerRingBufferWriter.o) 
     -[GTMLoggerRingBufferWriter reset] in libGoogleAnalytics.a(GTMLoggerRingBufferWriter.o) 
     -[GTMLoggerRingBufferWriter dumpContents] in libGoogleAnalytics.a(GTMLoggerRingBufferWriter.o) 
     -[GTMLoggerRingBufferWriter logMessage:level:] in libGoogleAnalytics.a(GTMLoggerRingBufferWriter.o) 
     +[GANTracker sharedTracker] in libGoogleAnalytics.a(GANTracker.o) 
     +[GANTracker allocWithZone:] in libGoogleAnalytics.a(GANTracker.o) 
     -[GANTracker startTrackerWithAccountID:dispatchPeriod:delegate:] in libGoogleAnalytics.a(GANTracker.o) 
     -[GANTracker trackPageview:withError:] in libGoogleAnalytics.a(GANTracker.o) 
     -[GANTracker trackEvent:action:label:value:withError:] in libGoogleAnalytics.a(GANTracker.o) 
     -[GANTracker stopTracker] in libGoogleAnalytics.a(GANTracker.o) 
     -[GANTracker dispatch] in libGoogleAnalytics.a(GANTracker.o) 
    ".objc_class_name_NSUserDefaults", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GTMLogger.o) 
    ".objc_class_name_NSThread", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GTMLogger+ASL.o) 
    ".objc_class_name_NSBundle", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GANDataDispatcher.o) 
    ".objc_class_name_NSAssertionHandler", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GANTracker.o) 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GANPersistentEventStore.o) 
    ".objc_class_name_NSLocale", referenced from: 
     [email protected][email protected][email protected] in libGoogleAnalytics.a(GANDataDispatcher.o) 
ld: symbol(s) not found 
collect2: ld returned 1 exit status 

Bir öneri simülatörü kullanım için GANTracker sınıfının bir kukla uygulanmasını yaratmaktır.

#import "GANTracker.h" 

#if TARGET_IPHONE_SIMULATOR 

@implementation GANTracker 

+ (GANTracker *)sharedTracker 
{ 
    return [[[GANTracker alloc] init] autorelease]; 
} 

- (void)startTrackerWithAccountID:(NSString *)accountID 
       dispatchPeriod:(NSInteger)dispatchPeriod 
        delegate:(id<GANTrackerDelegate>)delegate 
{ 
} 

- (void)stopTracker 
{ 
} 

- (BOOL)trackPageview:(NSString *)pageURL 
     withError:(NSError **)error 
{ 
    return YES; 
} 

- (BOOL)trackEvent:(NSString *)category 
     action:(NSString *)action 
     label:(NSString *)label 
     value:(NSInteger)value 
    withError:(NSError **)error 
{ 
    return YES; 
} 

- (BOOL)dispatch 
{ 
    return YES; 
} 

@end 
#endif 

Ancak bu benim için çalışmıyor, ben özlüyorum şey var: yani bir dosya GANTracker_stub.m oluşturmak için? Google Analytics forumu aracılığıyla bulundu

cevap

3

Çözüm:

Kullanım:

lipo libGoogleAnalytics.a -remove i386 -output libGoogleAnalytics2.a

Sonra

Bu, yalnızca birlikte libGoogleAnalytics2.a projenizden libGoogleAnalytics.a silip ekleyin Yukarıda gösterildiği gibi GANTracker'ın kukla uygulaması.

+0

Güzel bulun! Bu benim de sorunlara neden oldu. –

+0

Başka bir soru başlatabilirdim, ama lütfen GANTracker_stub.m ile tam olarak ne yaptığını söyler misiniz? Forumlardaki insanlar, kodu GANTracker_stub.m içine kopyalayıp, sonra ne yapacağını söylemiyorlar? -remove i386 ile çözüm, sim'in altında çalışmasına izin verecekmiş gibi görünmüyor mu? – Jann

+0

Az önce XCode kullanarak yeni bir dosya ekledim, GANTracker_Stub.m. GANTracker_Stub.h dosyasını silin ve yukarıdaki kodu kopyalayın. Daha sonra projenizi derlediğinizde, GANTracker_Stub.m otomatik olarak statik kitaplıktaki GANTracker uygulamasını geçersiz kılar. bu mantıklı mı? –

İlgili konular