AdMob 7.3.1 和 Swift 2.0 - 未找到模块 [英] AdMob 7.3.1 and Swift 2.0 - Module not found

查看:34
本文介绍了AdMob 7.3.1 和 Swift 2.0 - 未找到模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用带有 Swift 2.0 的 Google AdMob 框架时遇到问题.我是第一次使用 AdMob,所以我不知道问题出在 AdMob 还是 Swift 2.0 上.

I have a problem using the Google AdMob Framework with Swift 2.0. I'm using AdMob for the first time so I do not know if the problem is with AdMob or Swift 2.0.

我已经包含了 AdMob 框架,并将其导入到我的 ViewController 中:

I have included the AdMob Framework and import it like that in my ViewController:

import GoogleMobileAds

我得到的错误是:

没有这样的模块 GoogleMobileAds

No such Module GoogleMobileAds

桥接头也不起作用:

#import <GoogleMobileAds/GoogleMobileAds.h>

错误:

找不到 GoogleMobileAds/GoogleMobileAds.h 文件

GoogleMobileAds/GoogleMobileAds.h file not found

我应该如何加入 AdMob?我已经测试了 AdMob 6.12.2 并通过桥接头包含它并且它可以工作.

How should I include AdMob? I have tested AdMob 6.12.2 and included it via the bridging header and it works.

其他用户以前的帖子对我没有帮助 - 这个问题没有解决方案.

The previous posts from other users didn't help me - there were no solutions for this problem.

推荐答案

右击你的项目 -> 在 Finder 中显示 -> 创建新文件夹并在打开项目后复制 GoogleMobileAds.framework.

Right click your project -> Show in Finder -> Create New Folder and copy GoogleMobileAds.framework after open project.

选择项目-> 目标-> 构建阶段-> 将二进制文件与库链接-> 单击+"按钮-> 单击添加其他.. 按钮-> 选择 GoogleMobileAds.framework 并单击打开按钮.

Select project-> Targets -> Build Phases -> Link Binary With Libraries -> click "+" button -> click Add other.. button -> select GoogleMobileAds.framework and click Open button.

重新启动您的应用,然后编译 GoogleMobileAds 并将其导入您的 swift 视图控制器

Restart your app then compile and import GoogleMobileAds to your swift view controller

这篇关于AdMob 7.3.1 和 Swift 2.0 - 未找到模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆