无法使用 adMob api,因为我更新到 API 19 [英] Can´t use adMob api since I updated to API 19

查看:33
本文介绍了无法使用 adMob api,因为我更新到 API 19的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,如果我包含了 adMob sdk 的 .jar,它将与 google play services API 冲突,并且由于以下错误而导致应用无法编译:

Alright, If I include the .jar of the adMob sdk, it will conflict with the google play services API and the app wont compile because of the following error:

Unable to execute dex: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode;

如果我不在导出中包含 adMob .jar,它会在运行时崩溃,因为应用程序找不到广告所需的类并在我的布局文件中显示此消息:

If I dont include the adMob .jar on the exports, it will crash on runtime because the app couldnt find the classes required for the ad and it displays this message on my layout file:

The following classes could not be instantiated:
- com.google.ads.AdView

现在怎么办?我更新到 API 19 后它坏了.我使用的是 google play services API 修订版 13 和 6.4.1 版的 adMob .jar.

What now? It broke after I updated to API 19. Im using the google play services API revision 13 and version 6.4.1 of the adMob .jar.

推荐答案

这是我所做的.删除 AdMob.jar.删除所有与 AdMob 内容相关的导入.然后按照本指南更新您的代码,因为API 有所改变.

Here's what I did. Remove the AdMob.jar. Remove all your imports relating to AdMob stuff. Then follow this guide to update your code, because the API has changed somewhat.

这篇关于无法使用 adMob api,因为我更新到 API 19的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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