赞
踩
对于unity,直接用unity导出apk时,unity会合并manifest,把google的$Application_ID合并过来,但它还不识别'$'符号。
所以这里必须要用gradle导出工程后编译。
注意build.gradle中添加项:
compile 'com.google.android.gms:play-services-ads:11.4.0'
可能会出现:
You have not accepted the license agreements of the following SDK components:
[SDK Patch Applier v4, Android Support Repository, Google Repository].
You have not accepted the license agreements of the following SDK components:
[Android Support Repository].
许可信任等问题。
处理方式:
echo y | android update sdk --no-ui --all --filter "extra-google-m2repository"
echo y | android update sdk --no-ui --all --filter "extra-android-m2repository"
还要注意接好sdk后,测试时可能会遇到如下问题:
Received error HTTP response code: 400
There was a problem getting an ad response. ErrorCode: 0
Failed to load ad: 0
0_ERROR_CODE_INTERNAL_ERROR
这时检查后台付款信息,需要配置成功后才能投放。
另外,应用必须在谷歌商店提交,至少是alpha版本不然一样不会填充广告。
对于gradle中
项目级build.gradle的
- allprojects {
- repositories {
- google() 如果不支持google() 可以改成maven{url 'https://maven.google.com'}
- jcenter()
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。