• IOS项目中加入Google Admob SDK


    错误1. Undefined symbols for architecture i386:
      "_OBJC_CLASS_$_ASIdentifierManager", referenced from:
          objc-class-ref in libGoogleAdMobAds.a(GADIdentifierUtilities.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)

    除了《Google AdMob 广告 iOS 初级指南》(https://developers.google.com/mobile-ads-sdk/docs/ios/fundamentals?hl=zh-cn,此文篇后的最佳实践值得一看 )中所列出的几个lib需加入外,还需要加入AdSupport、StoreKit两个库

    错误2. [GADObjectPrivate changeState:]: unrecognized selector sent to instance 0x95c17d0'

    需要在build settings里的other linker flags添加-ObjC标志

    错误3. 无法正确显示广告,log打出“Cannot determine request type. Is your ad unit id correct?”

    需改代码:

    self.adBanner.adUnitID = kSampleAdUnitID;

    变量kSampleAdUnitID的定义指需改为你的Admob发布者ID。

     

     

  • 相关阅读:
    用python3实现linux的sed功能
    查找列表中指定的所有元素的位置
    Django分页
    python3中字典的copy
    Python中is和==的区别的
    python3的文件读写模式
    使用python3简单完成购物过程
    python3中str的函数
    第一篇
    《笑傲江湖》传剑摘录 有感而发
  • 原文地址:https://www.cnblogs.com/edgarli/p/Admob.html
Copyright © 2020-2023  润新知