【问题标题】:Admob Reward Video GADRewardBasedVideoAdDelegate Undefined symbolsAdmob 奖励视频 GADRewardBasedVideoAdDelegate 未定义符号
【发布时间】:2016-12-14 14:20:49
【问题描述】:

我最近根据本教程实现了 admob(7.9.1 版)奖励视频: https://firebase.google.com/docs/admob/ios/rewarded-video

但我无法使用此功能编译我的应用程序。 我收到此错误:

Undefined symbols for architecture x86_64:
  "l_OBJC_PROTOCOL_$_GADRewardBasedVideoAdDelegate", referenced from:
      l_OBJC_CLASS_PROTOCOLS_$_ViewController in libFramework.a(ViewController.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see     invocation)

我之前实施了横幅广告和插页式广告,效果很好。

有什么建议吗?

【问题讨论】:

    标签: ios objective-c admob


    【解决方案1】:

    正在导入GoogleMobileAds/GADRewardBasedVideoAdDelegate.h,一切正常。

    #import <GoogleMobileAds/GADRewardBasedVideoAdDelegate.h>
    

    【讨论】:

      【解决方案2】:

      该错误告诉您您没有导入所需的标头。你importGADRewardBasedVideoAd 标头了吗?

      #import "GADRewardBasedVideoAd.h"
      

      或者,您可以只导入整个 AdMob 框架。例如:

      @import GoogleMobileAds;
      

      Google 还在 GitHub 上提供了完整的 GADRewardBasedVideoAd 示例:RewardedVideoExample/ViewController.m

      【讨论】:

      • 头文件被导入。它实际上不是编译器错误(这意味着标头已找到并且正在工作)它是链接器错误。听起来框架内缺少 GADRewardBasedVideoAdDelegate
      • 好吧,我想通了。我还需要导入GoogleMobileAds/GADRewardBasedVideoAdDelegate.h。这很有趣,因为横幅广告和插页式广告不需要导入委托标头。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多