gpt4 book ai didi

ios - AdMob 问题和错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:08:02 25 4
gpt4 key购买 nike

我正在尝试在我的 iOS 应用中实现 AdMob。我遵循了他们提供的文档 here .因此,我尝试构建并运行,但出现以下错误:

Undefined symbols for architecture i386:
"_NSOverwriteMergePolicy", referenced from:
anon in libGoogleAnalyticsServices.a(GAIDataStore.o)
anon in libGoogleAnalyticsServices.a(TAGModel.o)
anon in libGoogleAnalyticsServices.a(GAIDataStore.o)
anon in libGoogleAnalyticsServices.a(TAGModel.o)
"_NSSQLiteErrorDomain", referenced from:
anon in libGoogleAnalyticsServices.a(GAIDataStore.o)
"_NSSQLiteStoreType", referenced from:
anon in libGoogleAnalyticsServices.a(GAIDataStore.o)
anon in libGoogleAnalyticsServices.a(TAGModel.o)
anon in libGoogleAnalyticsServices.a(GAIDataStore.o)
anon in libGoogleAnalyticsServices.a(TAGModel.o)
"_OBJC_CLASS_$_MFMailComposeViewController", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
"_OBJC_CLASS_$_MFMessageComposeViewController", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
"_OBJC_CLASS_$_NSAttributeDescription", referenced from:
objc-class-ref in libGoogleAnalyticsServices.a(GAICoreDataUtil.o)
objc-class-ref in libGoogleAnalyticsServices.a(TAGModel.o)
"_OBJC_CLASS_$_NSEntityDescription", referenced from:
objc-class-ref in libGoogleAnalyticsServices.a(GAIDataStore.o)
objc-class-ref in libGoogleAnalyticsServices.a(GAICoreDataUtil.o)
objc-class-ref in libGoogleAnalyticsServices.a(TAGDataProvider.o)
objc-class-ref in libGoogleAnalyticsServices.a(TAGModel.o)
"_OBJC_CLASS_$_NSFetchRequest", referenced from:
objc-class-ref in libGoogleAnalyticsServices.a(GAIDataStore.o)
objc-class-ref in libGoogleAnalyticsServices.a(TAGModel.o)
"_OBJC_CLASS_$_NSManagedObjectContext", referenced from:
objc-class-ref in libGoogleAnalyticsServices.a(GAIDataStore.o)
objc-class-ref in libGoogleAnalyticsServices.a(TAGModel.o)
"_OBJC_CLASS_$_NSManagedObjectModel", referenced from:
objc-class-ref in libGoogleAnalyticsServices.a(GAICoreDataUtil.o)
objc-class-ref in libGoogleAnalyticsServices.a(TAGModel.o)
"_OBJC_CLASS_$_NSPersistentStoreCoordinator", referenced from:
objc-class-ref in libGoogleAnalyticsServices.a(GAIDataStore.o)
objc-class-ref in libGoogleAnalyticsServices.a(TAGModel.o)
"_OBJC_CLASS_$_SKStoreProductViewController", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
"_SKStoreProductParameterITunesItemIdentifier", referenced from:
-[GADOpener openInAppStore:fallbackURLString:] in libGoogleAdMobAds.a(GADOpener.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

编辑 1: 我添加了 Storekit 和 MessageUI 框架并添加了 Obj-C 链接器标志,现在我得到了这个:

Undefined symbols for architecture i386:
"_NSOverwriteMergePolicy", referenced from:
anon in libGoogleAnalyticsServices.a(TAGModel.o)
anon in libGoogleAnalyticsServices.a(GAIDataStore.o)
-[GAIDataStore contextWithModel:URL:] in libGoogleAnalytics_debug.a(GAIDataStore.o)
anon in libGoogleAnalyticsServices.a(TAGModel.o)
anon in libGoogleAnalyticsServices.a(GAIDataStore.o)
-[GAIDataStore contextWithModel:URL:] in libGoogleAnalytics_debug.a(GAIDataStore.o)
anon in libGoogleAnalyticsServices.a(TAGModel.o)
anon in libGoogleAnalyticsServices.a(GAIDataStore.o)
-[GAIDataStore contextWithModel:URL:] in libGoogleAnalytics_debug.a(GAIDataStore.o)
"_NSSQLiteErrorDomain", referenced from:
anon in libGoogleAnalyticsServices.a(GAIDataStore.o)
-[GAIDataStore performBlockAndWait:withError:] in libGoogleAnalytics_debug.a(GAIDataStore.o)
anon in libGoogleAnalyticsServices.a(GAIDataStore.o)
-[GAIDataStore performBlockAndWait:withError:] in libGoogleAnalytics_debug.a(GAIDataStore.o)
"_NSSQLiteStoreType", referenced from:
anon in libGoogleAnalyticsServices.a(TAGModel.o)
anon in libGoogleAnalyticsServices.a(GAIDataStore.o)
-[GAIDataStore coordinatorWithModel:URL:] in libGoogleAnalytics_debug.a(GAIDataStore.o)
anon in libGoogleAnalyticsServices.a(TAGModel.o)
anon in libGoogleAnalyticsServices.a(GAIDataStore.o)
-[GAIDataStore coordinatorWithModel:URL:] in libGoogleAnalytics_debug.a(GAIDataStore.o)
anon in libGoogleAnalyticsServices.a(TAGModel.o)
anon in libGoogleAnalyticsServices.a(GAIDataStore.o)
-[GAIDataStore coordinatorWithModel:URL:] in libGoogleAnalytics_debug.a(GAIDataStore.o)
"_OBJC_CLASS_$_NSAttributeDescription", referenced from:
objc-class-ref in libGoogleAnalyticsServices.a(TAGModel.o)
objc-class-ref in libGoogleAnalyticsServices.a(GAICoreDataUtil.o)
objc-class-ref in libGoogleAnalytics_debug.a(GAICoreDataUtil.o)
"_OBJC_CLASS_$_NSEntityDescription", referenced from:
objc-class-ref in libGoogleAnalyticsServices.a(TAGDataProvider.o)
objc-class-ref in libGoogleAnalyticsServices.a(TAGModel.o)
objc-class-ref in libGoogleAnalyticsServices.a(GAIDataStore.o)
objc-class-ref in libGoogleAnalyticsServices.a(GAICoreDataUtil.o)
objc-class-ref in libGoogleAnalytics_debug.a(GAIDataStore.o)
objc-class-ref in libGoogleAnalytics_debug.a(GAICoreDataUtil.o)
"_OBJC_CLASS_$_NSFetchRequest", referenced from:
objc-class-ref in libGoogleAnalyticsServices.a(TAGModel.o)
objc-class-ref in libGoogleAnalyticsServices.a(GAIDataStore.o)
objc-class-ref in libGoogleAnalytics_debug.a(GAIDataStore.o)
"_OBJC_CLASS_$_NSManagedObject", referenced from:
_OBJC_CLASS_$_GAIHit in libGoogleAnalyticsServices.a(GAIHit.o)
_OBJC_CLASS_$_TAGHit in libGoogleAnalyticsServices.a(TAGHit.o)
_OBJC_CLASS_$_GAIProperty in libGoogleAnalyticsServices.a(GAIProperty.o)
_OBJC_CLASS_$_GAIProperty in libGoogleAnalytics_debug.a(GAIProperty.o)
_OBJC_CLASS_$_GAIHit in libGoogleAnalytics_debug.a(GAIHit.o)
"_OBJC_CLASS_$_NSManagedObjectContext", referenced from:
objc-class-ref in libGoogleAnalyticsServices.a(TAGModel.o)
objc-class-ref in libGoogleAnalyticsServices.a(GAIDataStore.o)
objc-class-ref in libGoogleAnalytics_debug.a(GAIDataStore.o)
"_OBJC_CLASS_$_NSManagedObjectModel", referenced from:
objc-class-ref in libGoogleAnalyticsServices.a(TAGModel.o)
objc-class-ref in libGoogleAnalyticsServices.a(GAICoreDataUtil.o)
objc-class-ref in libGoogleAnalytics_debug.a(GAICoreDataUtil.o)
"_OBJC_CLASS_$_NSPersistentStoreCoordinator", referenced from:
objc-class-ref in libGoogleAnalyticsServices.a(TAGModel.o)
objc-class-ref in libGoogleAnalyticsServices.a(GAIDataStore.o)
objc-class-ref in libGoogleAnalytics_debug.a(GAIDataStore.o)
"_OBJC_METACLASS_$_NSManagedObject", referenced from:
_OBJC_METACLASS_$_GAIHit in libGoogleAnalyticsServices.a(GAIHit.o)
_OBJC_METACLASS_$_TAGHit in libGoogleAnalyticsServices.a(TAGHit.o)
_OBJC_METACLASS_$_GAIProperty in libGoogleAnalyticsServices.a(GAIProperty.o)
_OBJC_METACLASS_$_GAIProperty in libGoogleAnalytics_debug.a(GAIProperty.o)
_OBJC_METACLASS_$_GAIHit in libGoogleAnalytics_debug.a(GAIHit.o)
"_llvm_gcda_emit_arcs", referenced from:
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDefaultLogger.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAITrackerImpl.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDataStore.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIError.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIHitUtil.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIURLConnection.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAITrackedViewController.o)
...
"_llvm_gcda_emit_function", referenced from:
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDefaultLogger.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAITrackerImpl.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDataStore.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIError.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIHitUtil.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIURLConnection.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAITrackedViewController.o)
...
"_llvm_gcda_end_file", referenced from:
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDefaultLogger.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAITrackerImpl.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDataStore.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIError.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIProperty.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIHitUtil.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIURLConnection.o)
...
"_llvm_gcda_increment_indirect_counter", referenced from:
-[GAITrackerImpl gai_set:value:] in libGoogleAnalytics_debug.a(GAITrackerImpl.o)
-[GAITrackerImpl gai_get:] in libGoogleAnalytics_debug.a(GAITrackerImpl.o)
-[GAITrackerImpl gai_send:] in libGoogleAnalytics_debug.a(GAITrackerImpl.o)
-[GAIDataStore performBlockAndWait:withError:] in libGoogleAnalytics_debug.a(GAIDataStore.o)
_GAIReachabilityStatusString in libGoogleAnalytics_debug.a(GAIReachabilityChecker.o)
-[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 libGoogleAnalytics_debug.a(GAIDefaultLogger.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAITrackerImpl.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDataStore.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIError.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIProperty.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIHitUtil.o)
___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIURLConnection.o)
...
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

最佳答案

AdMob docs说:

The SDK library references six iOS development frameworks which may not already be part of your project:

  • StoreKit
  • AudioToolbox
  • MessageUI
  • SystemConfiguration
  • CoreGraphics
  • AdSupport
  • EventKit
  • EventKitUI

您可以通过项目 View 添加这些框架,如引用文档中所示和解释的那样。您还必须使用 -ObjC 链接标志。

编辑:

请务必以与添加 iOS 框架相同的方式将 Google 库添加到您的项目中。查看this question and answer .

关于ios - AdMob 问题和错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19082012/

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