无法在Admob原生广告中查看属性错误

时间:2017-12-05 02:39:26

标签: android admob

我正在尝试在我的应用中实施原生广告。我已经完成了所有步骤。我添加了ad_app_install.xml,ad_content.xml的布局。这是我申请原生广告的代码:

AdLoader.Builder builder = new AdLoader.Builder(this, "ca-app-pub-3940256099942544/2247696110");
        AdLoader adLoader = builder.forAppInstallAd(new NativeAppInstallAd.OnAppInstallAdLoadedListener() {
            @Override
            public void onAppInstallAdLoaded(NativeAppInstallAd ad) {
                // An app install ad loaded successfully, call this method again to
                // load the next ad.
                mNativeAds.add(ad);
                loadNativeAd(adLoadCount + 1);

            }
        }).forContentAd(new NativeContentAd.OnContentAdLoadedListener() {
            @Override
            public void onContentAdLoaded(NativeContentAd ad) {
                // A content ad loaded successfully, call this method again to
                // load the next ad.
                mNativeAds.add(ad);
                loadNativeAd(adLoadCount + 1);
            }
        }).withAdListener(new AdListener() {
            @Override
            public void onAdFailedToLoad(int errorCode) {
                // A native ad failed to load. Call this method again to load
                // the next ad in the items list.
                Log.e("MainActivity", "The previous native ad failed to load. Attempting to"
                        + " load another.");
                loadNativeAd(adLoadCount + 1);
            }
        }).build();

我正在使用Admob的虚拟ID。但是每次运行我的应用程序时,我都会收到错误I/Ads: Received log message: <Google:HTML> Cannot read property 'tracking_urls_and_actions' of undefined 我搜索了这个错误,我无法找到解决方案。

1 个答案:

答案 0 :(得分:0)

当我在Play服务的新模拟器上运行AdMob codelab时,我也遇到了这个错误。在真实设备上运行并不会导致错误。