gpt4 book ai didi

iphone - libGoogleAnalytics.a 与 iPhone iOS4 模拟器的链接问题

转载 作者:行者123 更新时间:2023-12-03 18:45:35 25 4
gpt4 key购买 nike

我最近升级到了 iOS4 SDK,我的应用程序不再针对模拟器进行编译,但确实针对设备进行编译。

这是由第 3 方库 libGoogleAnalytics.a 造成的。解决方案似乎是谷歌发布一个符合新SDK的新静态库,不幸的是没有任何发布日期的消息,并且由于新SDK许可,他们可能永远不会发布新库。

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

我收到以下编译错误:

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:
literal-pointer@__OBJC@__cls_refs@NSFileManager in libGoogleAnalytics.a(GANPersistentEventStore.o)
".objc_class_name_NSString", referenced from:
literal-pointer@__OBJC@__cls_refs@NSString in libGoogleAnalytics.a(GTMLogger.o)
literal-pointer@__OBJC@__cls_refs@NSString in libGoogleAnalytics.a(GANTracker.o)
literal-pointer@__OBJC@__cls_refs@NSString in libGoogleAnalytics.a(GANPersistentEventStore.o)
".objc_class_name_NSError", referenced from:
literal-pointer@__OBJC@__cls_refs@NSError in libGoogleAnalytics.a(GANTracker.o)
literal-pointer@__OBJC@__cls_refs@NSError in libGoogleAnalytics.a(GANPersistentEventStore.o)
".objc_class_name_NSFileHandle", referenced from:
literal-pointer@__OBJC@__cls_refs@NSFileHandle in libGoogleAnalytics.a(GTMLogger.o)
".objc_class_name_NSMutableString", referenced from:
literal-pointer@__OBJC@__cls_refs@NSMutableString in libGoogleAnalytics.a(GANDataDispatcher.o)
".objc_class_name_NSTimer", referenced from:
literal-pointer@__OBJC@__cls_refs@NSTimer in libGoogleAnalytics.a(GANTracker.o)
".objc_class_name_NSMutableArray", referenced from:
literal-pointer@__OBJC@__cls_refs@NSMutableArray in libGoogleAnalytics.a(GANDataDispatcher.o)
literal-pointer@__OBJC@__cls_refs@NSMutableArray in libGoogleAnalytics.a(GANPersistentEventStore.o)
".objc_class_name_UIScreen", referenced from:
literal-pointer@__OBJC@__cls_refs@UIScreen in libGoogleAnalytics.a(GANDataDispatcher.o)
".objc_class_name_NSProcessInfo", referenced from:
literal-pointer@__OBJC@__cls_refs@NSProcessInfo 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:
literal-pointer@__OBJC@__cls_refs@NSDate in libGoogleAnalytics.a(GTMLogger.o)
literal-pointer@__OBJC@__cls_refs@NSDate in libGoogleAnalytics.a(GANPersistentEventStore.o)
".objc_class_name_UIDevice", referenced from:
literal-pointer@__OBJC@__cls_refs@UIDevice 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:
literal-pointer@__OBJC@__cls_refs@NSDateFormatter 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:
literal-pointer@__OBJC@__cls_refs@NSUserDefaults in libGoogleAnalytics.a(GTMLogger.o)
".objc_class_name_NSThread", referenced from:
literal-pointer@__OBJC@__cls_refs@NSThread in libGoogleAnalytics.a(GTMLogger+ASL.o)
".objc_class_name_NSBundle", referenced from:
literal-pointer@__OBJC@__cls_refs@NSBundle in libGoogleAnalytics.a(GANDataDispatcher.o)
".objc_class_name_NSAssertionHandler", referenced from:
literal-pointer@__OBJC@__cls_refs@NSAssertionHandler in libGoogleAnalytics.a(GANTracker.o)
literal-pointer@__OBJC@__cls_refs@NSAssertionHandler in libGoogleAnalytics.a(GANPersistentEventStore.o)
".objc_class_name_NSLocale", referenced from:
literal-pointer@__OBJC@__cls_refs@NSLocale in libGoogleAnalytics.a(GANDataDispatcher.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

Google 论坛上的一个建议是创建 GANTracker 类的虚拟实现以在模拟器中使用。即创建一个文件GANTracker_stub.m:

#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

但这对我不起作用,我缺少什么吗?

最佳答案

通过 Google Analytics 论坛找到的解决方案:

用途:


lipo libGoogleAnalytics.a -删除 i386 -输出 libGoogleAnalytics2.a

然后从您的项目中删除 libGoogleAnalytics.a 并添加 libGoogleAnalytics2.a

这只能与 GANTracker 的虚拟实现结合使用,如上所示。

关于iphone - libGoogleAnalytics.a 与 iPhone iOS4 模拟器的链接问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3128788/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com