android - 无法读取 Admob 原生广告中的属性错误

标签 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 我搜索了这个错误,但找不到解决方案。

最佳答案

当我在带有 Play 服务的新模拟器上运行 AdMob 代码实验室时,我也遇到了这个错误。在真实设备上运行没有导致错误。

关于android - 无法读取 Admob 原生广告中的属性错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47645233/

相关文章:

android - 如何使用 KSoap2 Android API 以 xml 格式获取 Web 服务的响应?

android - Twitch API,流 URL

java - 检索太多行后,Asynctask 不起作用

android - Robotium 相当于 Espresso 中的 drag()?

android - 原生广告 : How to access URL for open browser with CustomTemplateAd's

ios - 如何加载 AdMob 中介适配器

android - 如何避免在 AdMob 的 XML 中复制/粘贴 adUnitId?用于测试和发布

java - 位图压缩如何在 android 中工作?

android - Admob interstitial 在没有项目更改的情况下停止工作

java - Admob 间质性单例模式 java.lang.NullPointerException :