Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了android – 没有来自广告服务器的填充大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我知道这个主题已被多次发布,但是对于这个问题没有真正的解决方案.

最近,在很少的应用程序中,我决定进行更新.这是一个次要的更新库版本(也是admob)和最新版本.我也将targetSdkVersion从25改为26.几天后我检查了admob的统计数据,在所有这些应用程序中,填充率已降至0!请求数量增加了.对于横幅和插页式广告.其他应用程序不受影响.

我认为有一些愚蠢的错误,但我在代码找不到任何问题.

在横幅和插页式广告的日志中,我看到了这个:

我已尽力简化问题,因此我从Android工作室模板创建了一个全新的项目 – Google AdMob广告活动,我已将软件包名称设置为其一个受影响的应用程序.结果是一样的.仍然没有填补.

>我尝试添加设备作为测试设备和此日志

正在证实这一点.

>我尝试过使用此帖子中的虚拟广告ID:Is there any AdMob dummy id?
>我尝试使用不同sdk级别的不同设备.
>我尝试过使用firebase-ads和play-services-ads.
>我尝试过使用旧的admob sdks.
>我尝试过使用较低的targerSdkVersions.

所有这些都没有给我什么.但我发现只有一种方法:改变套餐名称.立即,无论广告是什么,如果它是一个测试设备,我总是得到一个广告.插页式广告和横幅广告.

这是我的MainActivity.java代码

public class MainActivity extends AppCompatActivity {

    public static final String ADMOB_INTERSTITIAL_DUMMY = "ca-app-pub-3940256099942544/1033173712";
    public static final String ADMOB_INTERSTITIAL = "ca-app-pub-my_own_ad_id";
    public interstitialAd interstitial;

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

        AdView adView = (AdView) findViewById(R.id.adView);
        adView.loadAd(newAdrequest());

        interstitial = new InterstitialAd(this);
        interstitial.setAdUnitId(ADMOB_INTERSTITIAL_DUMMY); //ADMOB_INTERSTITIAL
        interstitial.loadAd(newAdrequest());

        interstitial.setAdListener(new AdListener() {

            @Override
            public void onAdClosed() {
                super.onAdClosed();
                interstitial.loadAd(newAdrequest());
            }

        });

        Button btnShowAd = (Button) findViewById(R.id.btnShowAd);
        btnShowAd.setOnClickListener(new View.onClickListener() {
            @Override
            public void onClick(View view) {
                if(interstitial != null){
                    if(interstitial.isLoaded()){
                        interstitial.show();
                    }
                }
            }
        });
    }

    private static Adrequest newAdrequest() {
        Adrequest adrequest = new Adrequest.builder()
                .addTestDevice(Adrequest.DEVICE_ID_EMULATOR)
                .addTestDevice("device_1")
                .addTestDevice("device_2")
                .addTestDevice("device_3")
                .addTestDevice("device_4")
                .build();
        return adrequest;
    }

}

AndroidManifest.xml(认来自AdMob项目模板):

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://scheR_895_11845@as.android.com/apk/res/android"
    package="pl.rosmedia.memo">

    <!-- Include required permissions for Google Mobile Ads to run. -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:allowBACkup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@String/app_name"
        android:rounDicon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <!-- This Meta-data tag is required to use Google Play services. -->
        <Meta-data
            android:name="com.google.android.gms.version"
            android:value="@Integer/google_play_services_version" />

        <activity
            android:name=".MainActivity"
            android:label="@String/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity> <!-- Include the AdActivity configChanges and theme. -->
        <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>

完整日志:

09-06 11:48:41.930 27309-27309/pl.rosmedia.memo W/resourcesmanager: getTopLevelresources: /data/app/pl.rosmedia.memo-2/base.apk / 1.0 running in pl.rosmedia.memo rsrc of package pl.rosmedia.memo
09-06 11:48:41.940 27309-27309/pl.rosmedia.memo I/InjectionManager: Inside getClassLibPath + mLibMap{0=,1=}
09-06 11:48:42.010 27309-27309/pl.rosmedia.memo D/resourcesmanager: For user 0 new overlays fetched Null
09-06 11:48:42.020 27309-27309/pl.rosmedia.memo W/ActivityThread: Application pl.rosmedia.memo is waiTing for the debugger on port 8100...
09-06 11:48:42.030 27309-27309/pl.rosmedia.memo I/Sy@R_502_2407@.out: Sending WAIT chunk
09-06 11:48:42.050 27309-27316/pl.rosmedia.memo I/art: Debugger is active
09-06 11:48:42.230 27309-27309/pl.rosmedia.memo I/Sy@R_502_2407@.out: Debugger has connected
09-06 11:48:42.230 27309-27309/pl.rosmedia.memo I/Sy@R_502_2407@.out: waiTing for debugger to settle...
09-06 11:48:42.430 27309-27309/pl.rosmedia.memo I/Sy@R_502_2407@.out: waiTing for debugger to settle...
09-06 11:48:42.631 27309-27309/pl.rosmedia.memo I/Sy@R_502_2407@.out: waiTing for debugger to settle...
09-06 11:48:42.831 27309-27309/pl.rosmedia.memo I/Sy@R_502_2407@.out: waiTing for debugger to settle...
09-06 11:48:43.031 27309-27309/pl.rosmedia.memo I/Sy@R_502_2407@.out: waiTing for debugger to settle...
09-06 11:48:43.231 27309-27309/pl.rosmedia.memo I/Sy@R_502_2407@.out: waiTing for debugger to settle...
09-06 11:48:43.441 27309-27309/pl.rosmedia.memo I/Sy@R_502_2407@.out: waiTing for debugger to settle...
09-06 11:48:43.642 27309-27309/pl.rosmedia.memo I/Sy@R_502_2407@.out: debugger has settled (1410)
09-06 11:48:43.642 27309-27309/pl.rosmedia.memo I/InjectionManager: Inside getClassLibPath caller 
09-06 11:48:43.682 27309-27309/pl.rosmedia.memo D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
09-06 11:48:43.712 27309-27309/pl.rosmedia.memo D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
09-06 11:48:43.742 27309-27309/pl.rosmedia.memo I/FA: App measurement is starTing up,version: 11200
09-06 11:48:43.742 27309-27309/pl.rosmedia.memo I/FA: To enable debug logging run: adb sHell setprop log.tag.FA VERBOSE
09-06 11:48:43.772 27309-27309/pl.rosmedia.memo W/resourcesmanager: getTopLevelresources: /data/app/pl.rosmedia.memo-2/base.apk / 1.0 running in pl.rosmedia.memo rsrc of package pl.rosmedia.memo
09-06 11:48:43.782 27309-27309/pl.rosmedia.memo V/FA: Collection enabled
09-06 11:48:43.782 27309-27309/pl.rosmedia.memo V/FA: App package,Google App id: pl.rosmedia.memo,1:354797241783:android:9cf595305e60aa3a
09-06 11:48:43.782 27309-27309/pl.rosmedia.memo I/FA: To enable faster debug mode event logging run:
                                                        adb sHell setprop debug.firebase.analytics.app pl.rosmedia.memo
09-06 11:48:43.782 27309-27309/pl.rosmedia.memo D/FA: Debug-level message logging enabled
09-06 11:48:43.802 27309-27309/pl.rosmedia.memo V/FA: Registered activity lifecycle callBACk
09-06 11:48:43.802 27309-27309/pl.rosmedia.memo I/FirebaseInitProvider: FirebaseApp initialization successful
09-06 11:48:43.812 27309-27309/pl.rosmedia.memo D/InjectionManager: InjectionManager
09-06 11:48:43.812 27309-27309/pl.rosmedia.memo D/InjectionManager: fillFeatureStoreMap pl.rosmedia.memo
09-06 11:48:43.812 27309-27309/pl.rosmedia.memo I/InjectionManager: Constructor pl.rosmedia.memo,Feature store :{}
09-06 11:48:43.812 27309-27309/pl.rosmedia.memo I/InjectionManager: featureStore :{}
09-06 11:48:43.812 27309-27415/pl.rosmedia.memo V/FA: Using measurement service
09-06 11:48:43.822 27309-27415/pl.rosmedia.memo V/FA: ConnecTing to remote service
09-06 11:48:43.832 27309-27309/pl.rosmedia.memo W/resourcesmanager: getTopLevelresources: /data/app/pl.rosmedia.memo-2/base.apk / 1.0 running in pl.rosmedia.memo rsrc of package pl.rosmedia.memo
09-06 11:48:43.842 27309-27309/pl.rosmedia.memo W/resourceType: Failure getTing entry for 0x01080946 (t=7 e=2374) (error -75)
09-06 11:48:43.862 27309-27415/pl.rosmedia.memo V/FA: Using measurement service
09-06 11:48:43.862 27309-27415/pl.rosmedia.memo V/FA: Connection attempt already in progress
09-06 11:48:43.862 27309-27309/pl.rosmedia.memo W/art: Before Android 4.1,method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updatetintFilter(android.graphics.PorterDuffColorFilter,android.content.res.ColorStateList,android.graphics.PorterDuff$ModE) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
09-06 11:48:43.882 27309-27309/pl.rosmedia.memo V/FA: onActivityCreated
09-06 11:48:43.902 27309-27309/pl.rosmedia.memo D/PhoneWindow: *FMB* installDecor mIsFloaTing : false
09-06 11:48:43.902 27309-27309/pl.rosmedia.memo D/PhoneWindow: *FMB* installDecor flags : -2139029248
09-06 11:48:43.992 27309-27309/pl.rosmedia.memo D/TextView: setTypeface with style : 0
09-06 11:48:43.992 27309-27309/pl.rosmedia.memo D/TextView: setTypeface with style : 0
09-06 11:48:44.012 27309-27309/pl.rosmedia.memo D/TextView: setTypeface with style : 0
09-06 11:48:44.042 27309-27309/pl.rosmedia.memo W/resourcesmanager: getTopLevelresources: /data/app/com.google.android.gms-2/base.apk / 1.0 running in pl.rosmedia.memo rsrc of package com.google.android.gms
09-06 11:48:44.052 27309-27309/pl.rosmedia.memo D/resourcesmanager: For user 0 new overlays fetched Null
09-06 11:48:44.052 27309-27309/pl.rosmedia.memo W/resourcesmanager: Asset path '/sy@R_502_2407@/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
09-06 11:48:44.052 27309-27309/pl.rosmedia.memo W/resourcesmanager: Asset path '/sy@R_502_2407@/framework/com.android.LOCATIOn.provider.jar' does not exist or contains no resources.
09-06 11:48:44.052 27309-27309/pl.rosmedia.memo W/resourcesmanager: getTopLevelresources: /data/app/com.google.android.gms-2/base.apk / 1.0 running in pl.rosmedia.memo rsrc of package com.google.android.gms
09-06 11:48:44.052 27309-27309/pl.rosmedia.memo I/InjectionManager: Inside getClassLibPath caller 
09-06 11:48:44.112 27309-27309/pl.rosmedia.memo W/resourcesmanager: getTopLevelresources: /data/app/com.google.android.gms-2/base.apk / 1.0 running in pl.rosmedia.memo rsrc of package com.google.android.gms
09-06 11:48:44.132 27309-27309/pl.rosmedia.memo W/resourcesmanager: getTopLevelresources: /data/app/com.google.android.gms-2/base.apk / 1.0 running in pl.rosmedia.memo rsrc of package com.google.android.gms
09-06 11:48:44.142 27309-27309/pl.rosmedia.memo D/resourcesmanager: For user 0 new overlays fetched Null
09-06 11:48:44.142 27309-27309/pl.rosmedia.memo W/resourcesmanager: Asset path '/sy@R_502_2407@/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
09-06 11:48:44.142 27309-27309/pl.rosmedia.memo W/resourcesmanager: Asset path '/sy@R_502_2407@/framework/com.android.LOCATIOn.provider.jar' does not exist or contains no resources.
09-06 11:48:44.222 27309-27309/pl.rosmedia.memo D/ApplicationPackageManager: getresourcesForApplication com.google.android.gms got new pi = android.app.LoadedApk@2ba64dff
09-06 11:48:44.222 27309-27309/pl.rosmedia.memo W/resourcesmanager: getTopLevelresources: /data/data/com.google.android.gms/app_chimera/m/00000012/DynamiteModulesA_Gmscore_prodlmp_xhdpi_release.apk / 1.0 running in pl.rosmedia.memo rsrc of package com.google.android.gms
09-06 11:48:44.222 27309-27309/pl.rosmedia.memo D/resourcesmanager: For user 0 new overlays fetched Null
09-06 11:48:44.222 27309-27309/pl.rosmedia.memo D/ApplicationPackageManager: getresourcesForApplication com.google.android.gms got new pi = android.app.LoadedApk@2ba64dff
09-06 11:48:44.222 27309-27309/pl.rosmedia.memo W/resourcesmanager: getTopLevelresources: /data/data/com.google.android.gms/app_chimera/m/00000012/DynamiteModulesA_Gmscore_prodlmp_xhdpi_release.apk / 1.0 running in pl.rosmedia.memo rsrc of package com.google.android.gms
09-06 11:48:44.222 27309-27309/pl.rosmedia.memo D/DynamitePackage: Instantiated singleton DynamitePackage.
09-06 11:48:44.222 27309-27309/pl.rosmedia.memo D/DynamitePackage: InstantiaTing com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
09-06 11:48:44.262 27309-27309/pl.rosmedia.memo W/resourcesmanager: getTopLevelresources: /data/app/com.google.android.gms-2/base.apk / 1.0 running in pl.rosmedia.memo rsrc of package com.google.android.gms
09-06 11:48:44.262 27309-27309/pl.rosmedia.memo W/resourcesmanager: getTopLevelresources: /data/app/com.google.android.gms-2/base.apk / 1.0 running in pl.rosmedia.memo rsrc of package com.google.android.gms
09-06 11:48:44.322 27309-27309/pl.rosmedia.memo W/resourcesmanager: getTopLevelresources: /data/app/com.google.android.gms-2/base.apk / 1.0 running in pl.rosmedia.memo rsrc of package com.google.android.gms
09-06 11:48:44.392 27309-27309/pl.rosmedia.memo I/Ads: StarTing ad request.
09-06 11:48:44.392 27309-27309/pl.rosmedia.memo I/Ads: This request is sent from a test device.
09-06 11:48:44.402 27309-27463/pl.rosmedia.memo W/linker: libwebviewchromium.so: unused DT entry: type 0x6ffffffe arg 0x11c98
09-06 11:48:44.402 27309-27463/pl.rosmedia.memo W/linker: libwebviewchromium.so: unused DT entry: type 0x6fffffff arg 0x3
09-06 11:48:44.422 27309-27309/pl.rosmedia.memo D/DynamitePackage: InstantiaTing com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
09-06 11:48:44.442 27309-27309/pl.rosmedia.memo I/Ads: StarTing ad request.
09-06 11:48:44.442 27309-27309/pl.rosmedia.memo I/Ads: This request is sent from a test device.
09-06 11:48:44.462 27309-27309/pl.rosmedia.memo D/Activity: performCreate Call Injection manager
09-06 11:48:44.462 27309-27415/pl.rosmedia.memo I/FA: Tag Manager is not found and thus will not be used
09-06 11:48:44.462 27309-27415/pl.rosmedia.memo D/FA: Logging event (FE): ad_query(_aq),Bundle[{firebase_event_origin(_o)=am,ad_event_id(_aEID)=6721003539668014743}]
09-06 11:48:44.472 27309-27309/pl.rosmedia.memo I/InjectionManager: dispatchOnViewCreated > Target : pl.rosmedia.memo.MainActivity isFragment :false
09-06 11:48:44.492 27309-27415/pl.rosmedia.memo V/FA: Using measurement service
09-06 11:48:44.492 27309-27415/pl.rosmedia.memo V/FA: Connection attempt already in progress
09-06 11:48:44.492 27309-27415/pl.rosmedia.memo D/FA: Logging event (FE): ad_query(_aq),ad_event_id(_aEID)=6721003539668014744}]
09-06 11:48:44.492 27309-27472/pl.rosmedia.memo D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: false
09-06 11:48:44.502 27309-27463/pl.rosmedia.memo I/WebViewFactory: Loading com.google.android.webview version 60.0.3112.116 (code 311211600)
09-06 11:48:44.502 27309-27463/pl.rosmedia.memo W/resourcesmanager: getTopLevelresources: /data/app/com.google.android.webview-1/base.apk / 1.0 running in pl.rosmedia.memo rsrc of package com.google.android.webview
09-06 11:48:44.502 27309-27415/pl.rosmedia.memo V/FA: Using measurement service
09-06 11:48:44.502 27309-27415/pl.rosmedia.memo V/FA: Connection attempt already in progress
09-06 11:48:44.502 27309-27415/pl.rosmedia.memo V/FA: Using measurement service
09-06 11:48:44.502 27309-27415/pl.rosmedia.memo V/FA: Connection attempt already in progress
09-06 11:48:44.502 27309-27415/pl.rosmedia.memo V/FA: Activity resumed,time: 1210576665
09-06 11:48:44.512 27309-27415/pl.rosmedia.memo D/FA: Logging event (FE): screen_view(_vs),Bundle[{firebase_event_origin(_o)=auto,firebase_screen_class(_sC)=MainActivity,firebase_screen_id(_si)=6721003539668014745}]
09-06 11:48:44.522 27309-27309/pl.rosmedia.memo D/PhoneWindow: *FMB* isFloaTingMenuEnabled mFloaTingMenuBtn : null
09-06 11:48:44.522 27309-27309/pl.rosmedia.memo D/PhoneWindow: *FMB* isFloaTingMenuEnabled return false
09-06 11:48:44.522 27309-27415/pl.rosmedia.memo V/FA: Using measurement service
09-06 11:48:44.522 27309-27415/pl.rosmedia.memo V/FA: Connection attempt already in progress
09-06 11:48:44.552 27309-27463/pl.rosmedia.memo D/resourcesmanager: For user 0 new overlays fetched Null
09-06 11:48:44.552 27309-27463/pl.rosmedia.memo I/InjectionManager: Inside getClassLibPath caller 
09-06 11:48:44.562 27309-27472/pl.rosmedia.memo I/OpenGLRenderer: Initialized EGL,version 1.4
09-06 11:48:44.562 27309-27472/pl.rosmedia.memo D/OpenGLRenderer: Get maximum texture size. GL_MAX_TEXTURE_SIZE is 4096
09-06 11:48:44.562 27309-27472/pl.rosmedia.memo D/OpenGLRenderer: Enabling debug mode 0
09-06 11:48:44.592 27309-27463/pl.rosmedia.memo I/art: RejecTing re-init on prevIoUsly-Failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
09-06 11:48:44.592 27309-27463/pl.rosmedia.memo I/art: RejecTing re-init on prevIoUsly-Failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
09-06 11:48:44.602 27309-27463/pl.rosmedia.memo I/art: RejecTing re-init on prevIoUsly-Failed class java.lang.Class<com.android.webview.chromium.serviceWorkerControllerAdapter>
09-06 11:48:44.602 27309-27463/pl.rosmedia.memo I/art: RejecTing re-init on prevIoUsly-Failed class java.lang.Class<com.android.webview.chromium.serviceWorkerControllerAdapter>
09-06 11:48:44.602 27309-27309/pl.rosmedia.memo I/InjectionManager: dispatchCreateOptionsMenu :pl.rosmedia.memo.MainActivity
09-06 11:48:44.602 27309-27309/pl.rosmedia.memo I/InjectionManager: dispatchPrepareOptionsMenu :pl.rosmedia.memo.MainActivity
09-06 11:48:44.612 27309-27463/pl.rosmedia.memo I/cr_LibraryLoader: Time to load native libraries: 2 ms (timestamps 5014-5016)
09-06 11:48:44.622 27309-27463/pl.rosmedia.memo I/chromium: [INFO:library_loader_hooks.cc(144)] Chromium logging enabled: level = 0,default verbosity = 0
09-06 11:48:44.622 27309-27463/pl.rosmedia.memo I/cr_LibraryLoader: Expected native library version number "60.0.3112.116",actual native library version number "60.0.3112.116"
09-06 11:48:44.653 27309-27415/pl.rosmedia.memo D/FA: Connected to remote service
09-06 11:48:44.653 27309-27415/pl.rosmedia.memo V/FA: Processing queued up service tasks: 6
09-06 11:48:44.663 27309-27309/pl.rosmedia.memo I/Timeline: Timeline: Activity_idle id: android.os.binderProxy@452ebed time:486985066
09-06 11:48:44.953 27309-27318/pl.rosmedia.memo I/Ads: No fill from ad server.
09-06 11:48:44.953 27309-27321/pl.rosmedia.memo I/Ads: No fill from ad server.
09-06 11:48:44.963 27309-27309/pl.rosmedia.memo W/Ads: Failed to load ad: 3
09-06 11:48:44.963 27309-27309/pl.rosmedia.memo I/Ads: scheduling ad refresh 60000 milliseconds from Now.
09-06 11:48:44.963 27309-27309/pl.rosmedia.memo W/Ads: Failed to load ad: 3

这是否意味着我被禁止了?我没有收到来自admob的任何电子邮件,没有更改我展示广告的地方,而且在我更新它们的那一天同时发生了几个应用程序.在过去,我有类似的问题,但只是我的设备没有得到任何填充率,但它在世界范围内不是0,并且它在一段时间后恢复正常.但这种情况不同.

我知道这个话题:

failed to load ad : 3

但这不是缺少广告资源,同时在少数应用上也无法从90%上升到0%.

解决方法

这样做的原因是我必须检查应用程序是否符合COPPA,这使得这个应用程序在AdMob中“为孩子们”.但符合COPPA标准的广告的填充率非常低.不幸的是,没有办法取消选中COPPA,因为谷歌将拒绝这一改变.我从谷歌那里得知,这一变化是因为美国的一些法律变化.看起来他们想在儿童应用中杀死广告. 我们有一些应用程序,我们没有更新,因为我们不想检查COPPA,因此,它们的填充率接近100%.

大佬总结

以上是大佬教程为你收集整理的android – 没有来自广告服务器的填充全部内容,希望文章能够帮你解决android – 没有来自广告服务器的填充所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。