Admob ad错误代码:0。Everithyng已更新并经过仔细编程,设置为不显示广告 [英] Admob ad Error code : 0. Everithyng is updated and carefully programmed set it's not showing ads

查看:49
本文介绍了Admob ad错误代码:0。Everithyng已更新并经过仔细编程,设置为不显示广告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的错误代码:

07-31 13:37:47.413 31965-31965/corvusbyte.neverboredlite I/dalvikvm: Could not find method android.security.NetworkSecurityPolicy.getInstance, referenced from method com.google.android.gms.ads.internal.state.h.a
07-31 13:37:47.522 31965-31965/corvusbyte.neverboredlite D/DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraMobileAdsSettingManagerCreatorImpl
07-31 13:37:47.530 31965-31965/corvusbyte.neverboredlite I/dalvikvm: Could not find method android.security.NetworkSecurityPolicy.getInstance, referenced from method com.google.android.gms.ads.internal.state.h.a
07-31 13:37:47.544 31965-31965/corvusbyte.neverboredlite D/DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
07-31 13:37:47.620 31965-31965/corvusbyte.neverboredlite I/Ads: Starting ad request.
07-31 13:37:47.810 31965-31977/corvusbyte.neverboredlite D/IPCThreadState: [DN #5] BR_CLEAR_DEATH_NOTIFICATION_DONE cookie 0x63a2fa50
07-31 13:37:53.071 31965-31978/corvusbyte.neverboredlite D/IPCThreadState: [DN #5] BR_CLEAR_DEATH_NOTIFICATION_DONE cookie 0x63a34d80
07-31 13:37:58.169 31965-31977/corvusbyte.neverboredlite W/Ads: There was a problem getting an ad response. ErrorCode: 0
07-31 13:37:58.171 31965-31965/corvusbyte.neverboredlite W/Ads: Failed to load ad: 0
07-31 13:38:03.175 31965-31978/corvusbyte.neverboredlite D/IPCThreadState: [DN #5] BR_CLEAR_DEATH_NOTIFICATION_DONE cookie 0x64331428
07-31 13:39:18.091 31965-31965/corvusbyte.neverboredlite D/ActivityThread: BDC-Calling onReceive: intent=Intent { act=android.intent.action.SCREEN_OFF flg=0x50000010 }, ordered=true, receiver=com.google.android.gms.ads.internal.util.ac@4214bf40, IIntentReceiver=4214bf88

我的xml(广告的一部分):

My xml (the ad part of it):

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:ads="http://schemas.android.com/apk/res-auto">

    <com.google.android.gms.ads.AdView
        android:id="@+id/adView_main"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_alignParentBottom="true"
        ads:adSize="SMART_BANNER"
        ads:adUnitId="@string/main_ad_unit_id">
    </com.google.android.gms.ads.AdView>

我的Java(部分):

My java (part of it):

import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.MobileAds;


public class MainActivity extends AppCompatActivity {

    private AdView mAdView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        MobileAds.initialize(getApplicationContext(), "app_id");
        mAdView = (AdView) findViewById(R.id.adView_main);
        AdRequest adRequest = new AdRequest.Builder()
                .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
                .addTestDevice("85FB65B00143337DE5FE7492DF14F269")
                .build();
        mAdView.loadAd(adRequest);
    }

我的清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="corvusbyte.neverboredlite">

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

    <meta-data android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:largeHeap="true">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".ResultsActivity">
            <intent-filter>
                <action android:name="corvusbyte.neverboredlite.RESULTS"/>

                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>
        <activity android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent"/>
    </application>

</manifest>

我的gradle文件(部分):
模块

And my gradle files (parts of them): module

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.0.0'
    compile 'com.google.firebase:firebase-ads:9.2.1'
}
apply plugin: 'com.google.gms.google-services'

项目

dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'
        classpath 'com.google.gms:google-services:3.0.0'

我的问题是没有广告展示。我的布局顶部只有一个空白。我有最新的SDK工具,Google Play资源等...
请帮助我!

My problem is that there are no ads showing. There is only a blank space on the top of my layout. I have the latest SDK tools, Google Play resources etc... Please help me!

推荐答案

如您所说在注释中,您使用了 translatable = false 的属性。尝试将其删除,然后运行应用程序。可以通过代码进行访问,最终广告会出现。

As you said in the comments, you used attribute of translatable= "false". Try to remove it and then run application. It will be possible to be accessed by code and will eventually ads will come up.

这篇关于Admob ad错误代码:0。Everithyng已更新并经过仔细编程,设置为不显示广告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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