@H_403_1@从AdMobs开始,我遇到了一些奇怪的问题.
@H_403_1@第一个问题
@H_403_1@当我尝试通过此代码添加我的横幅时:
@H_403_1@
我重新安装了我的库,下载了lastet,删除并重新安装了……等等. @H_403_1@谢谢.
layout = (RelativeLayout) findViewById(R.id.adprincipal);
adView = new AdView(this);
adView.setAdUnitId("my unit id");
adView.setAdSize(AdSize.BANNER);
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice("my device")
.build();
// Load the adView with the ad request.
adView.loadAd(adRequest);
layout.addView(adView);
@H_403_1@如果我设置了尺寸AdSize.SMART_BANNER,但是我得到了AdSize.BANNER的测试横幅,但是无论如何(甚至是BANNER和SMART_BANNER)这是我从LogCat得到的:
@H_403_1@当横幅时
@H_403_1@
@H_403_1@12-30 04:41:00.380: W/ResourceType(27407): getEntry failing because entryIndex 13 is beyond type entryCount 5 @H_403_1@12-30 04:41:00.380: W/ResourceType(27407): Failure getting entry for 0x7f0b000d (t=10 e=13) in package 0 (error -2147483647) @H_403_1@12-30 04:41:00.380: E/GooglePlayServicesUtil(27407): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included. @H_403_1@12-30 04:41:00.400: W/ResourceType(27407): getEntry failing because entryIndex 13 is beyond type entryCount 5 @H_403_1@12-30 04:41:00.400: W/ResourceType(27407): Failure getting entry for 0x7f0b000d (t=10 e=13) in package 0 (error -2147483647) @H_403_1@12-30 04:41:00.400: E/GooglePlayServicesUtil(27407): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included. @H_403_1@12-30 04:41:02.111: I/GATE(27407): DEV_ACTION_COMPLETED @H_403_1@12-30 04:41:02.111: I/Ads(27407): Ad finished loading.@H_403_1@当SMART_BANNER @H_403_1@
@H_403_1@12-30 04:48:27.476: W/ResourceType(29507): getEntry failing because entryIndex 13 is beyond type entryCount 5 @H_403_1@12-30 04:48:27.476: W/ResourceType(29507): Failure getting entry for 0x7f0b000d (t=10 e=13) in package 0 (error -2147483647) @H_403_1@12-30 04:48:27.476: E/GooglePlayServicesUtil(29507): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included. @H_403_1@12-30 04:48:27.516: D/OpenGLRenderer(29507): Enabling debug mode 0 @H_403_1@12-30 04:48:27.576: W/ResourceType(29507): getEntry failing because entryIndex 13 is beyond type entryCount 5 @H_403_1@12-30 04:48:27.576: W/ResourceType(29507): Failure getting entry for 0x7f0b000d (t=10 e=13) in package 0 (error -2147483647) @H_403_1@12-30 04:48:27.576: E/GooglePlayServicesUtil(29507): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included. @H_403_1@12-30 04:48:31.450: I/Ads(29507): No fill from ad server. @H_403_1@12-30 04:48:31.450: W/Ads(29507): Failed to load ad: 3 @H_403_1@12-30 04:48:31.450: E/sqliteLog(29507): (14) cannot open file at line 30241 of [00bb9c9ce4] @H_403_1@12-30 04:48:31.450: E/sqliteLog(29507): (14) os_unix.c:30241: (2) open(/NotificationPermissions.db) – @H_403_1@12-30 04:48:31.450: D/WebKit(29507): ERROR: @H_403_1@12-30 04:48:31.450: D/WebKit(29507): sqlite database Failed to load from /NotificationPermissions.db @H_403_1@12-30 04:48:31.450: D/WebKit(29507): Cause – unable to open database file @H_403_1@12-30 04:48:31.450: D/WebKit(29507): external/webkit/Source/WebCore/platform/sql/sqliteDatabase.cpp(71) : bool WebCore::sqliteDatabase::open(const WTF::String&,bool)@H_403_1@并且SMART BANNER无法加载 @H_403_1@第二个问题 @H_403_1@我得到了与设置INTERSTITIAL的“BANNER”相同的错误,但它最终加载…… @H_403_1@怎么了?? @H_403_1@我试过了:this,this和this
我重新安装了我的库,下载了lastet,删除并重新安装了……等等. @H_403_1@谢谢.
最佳答案
在模拟器更改如下:
@H_403_1@
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice("my device")
.build();
@H_403_1@至
@H_403_1@
AdRequest request = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR) // All emulators
.addTestDevice("B3EEABB8EE11C2BE770B684D95219ECB") // Emulator id you will get in the LogCat verbose
.build();
adView.loadAd(request);
@H_403_1@在真实设备上:
@H_403_1@
adView.loadAd(new AdRequest.Builder().build());
@H_403_1@另外,如果您的ad_unit_id广告启用了BANNER,SMART BANNER和INTERSTITIAL,请检查您的广告服务器(最可能是AdMob).