xcode 在 iOS 中找不到模块“GoogleMobileAds”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38634925/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:05:25  来源:igfitidea点击:

Module 'GoogleMobileAds' not found in iOS

iosxcodeunity3dadmob

提问by Bear Heaven

Came across a topic with similar problem, but was unable to solve it.

遇到一个有类似问题的主题,但无法解决。

Integrated Admob ads in Unity app for ios and loaded the project in XCode. Added framework GoogleMobileAds simply dragging it into the project window. Unfortunately when you build the project the error is displayed.

在 ios 的 Unity 应用程序中集成 Admob 广告并在 XCode 中加载项目。添加了框架 GoogleMobileAds,只需将其拖入项目窗口即可。不幸的是,当您构建项目时,会显示错误。

I tryed replace GoogleMobileAds.hon #import <GoogleMobileAds/GoogleMobileAds.h>in GADUNativeCustomTemplateAd.h but it not help me.

我尝试在 GADUNativeCustomTemplateAd.h 中替换GoogleMobileAds.h#import <GoogleMobileAds/GoogleMobileAds.h>但它对我没有帮助。

Used Google Mobile Ads Unity Plugin v3.0.4 Xcode v. 7.3.1 Error: umbrella header googlemobileads h not found 1 img2 img

使用 Google Mobile Ads Unity Plugin v3.0.4 Xcode v. 7.3.1 错误:伞头 googlemobileads h not found 1 img 2 img

回答by Nil

I finally found the solution in this video https://www.youtube.com/watch?v=rxO_rcMxGU4, here is a summary:

我终于在这个视频https://www.youtube.com/watch?v=rxO_rcMxGU4 中找到了解决方案,这里是一个总结:

  1. Download googlemobileadssdkios.zip from https://firebase.google.com/docs/admob/ios/download

  2. Unzip file. Go to Project Navigator View. Move the unzip file inside the Framework folder.

  3. Build the code, if it doesn't work then substitute the string that gives error with

    • (void)loadRequest:(GADRequest *)request withAdUnitID:(NSString *)adUnitID userID:(NSString *)userID {
  1. https://firebase.google.com/docs/admob/ios/download下载 googlemobileadssdkios.zip

  2. 解压缩文件。转到项目导航器视图。将解压文件移动到 Framework 文件夹中。

  3. 构建代码,如果它不起作用,则将给出错误的字符串替换为

    • (void)loadRequest:(GADRequest *)request withAdUnitID:(NSString *)adUnitID userID:(NSString *)userID {

[self.rewardBasedVideo loadRequest:request withAdUnitID:adUnitID]; }

[self.rewardBasedVideo loadRequest:request withAdUnitID:adUnitID]; }

回答by AjayPandiyaraj

Check whether you have added the following libraries

检查您是否添加了以下库

  • Sqlite
  • Core data
  • System Configuration
  • libz
  • adSupport
  • Sqlite
  • 核心数据
  • 系统配置
  • 广告支持

add these libraries in the "Frameworks and Libraries" in Project settings

在项目设置的“框架和库”中添加这些库