• 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。

     

     

  • 相关阅读:
    阅读《构建之法》1-5章
    构建之法第8,9,10章
    实验5-封装与测试2
    第六次作业-my Backlog
    保存内容
    实验四-单元测试
    实验3—修改版
    做汉堡-57号
    实验3-2
    201306114357-实验3-C语言
  • 原文地址:https://www.cnblogs.com/edgarli/p/Admob.html
Copyright © 2020-2023  润新知