1

AdMob の動画リワード広告を実装しようとしています。エラーログから理解している限り、広告はデバイスによって読み込まれていますが、システムでは再生されていません。Android マニフェスト ファイルの読み取りと書き込みのアクセス許可も持っていますが、まだビデオ広告を再生していません。

onRewardedVideoAdFailedToLoadさらに、コードの Ref #2 であるこの関数でエラーが表示されます。

誰でも私の間違いを読んで指摘できますか?

これは、表示されていない広告について取得しているエラー ログです。

06-29 15:54:05.021 1548-1548/test.my.app D/ViewRootImpl: ViewPostImeInputStage processPointer 0
06-29 15:54:05.071 1548-1548/test.my.app D/ViewRootImpl: ViewPostImeInputStage processPointer 1
06-29 15:54:05.111 1548-1548/test.my.app D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: true
06-29 15:54:05.111 1548-1548/test.my.app D/cr_Ime: [InputMethodManagerWrapper.java:68] hideSoftInputFromWindow
06-29 15:54:05.131 1548-1548/test.my.app I/Ads: Ad closing.
06-29 15:54:05.191 1548-1548/test.my.app I/Timeline: Timeline: Activity_launch_request id:test.my.app time:476669498
06-29 15:54:05.221 1548-1548/test.my.app W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
06-29 15:54:05.231 1548-1548/test.my.app W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 1548
06-29 15:54:05.231 1548-1548/test.my.app D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: true
06-29 15:54:05.231 1548-1548/test.my.app D/cr_Ime: [InputMethodManagerWrapper.java:68] hideSoftInputFromWindow
06-29 15:54:05.231 1548-1548/test.my.app V/ActivityThread: updateVisibility : ActivityRecord{84787f5 token=android.os.BinderProxy@d104b02 {test.my.app/test.my.app.ShowAdActivity}} show : false
06-29 15:54:05.261 1548-1548/test.my.app W/ResourcesManager: getTopLevelResources: /data/app/vtest.my.app-2/base.apk / 1.0 running in test.my.app rsrc of package test.my.app
06-29 15:54:05.281 1548-1548/test.my.app I/AdColony: ==== Adapter version 1.1.0 ====
06-29 15:54:05.281 1548-1548/test.my.app I/AdColony: ==== Configuring AdColony 2.3.5 with app/zone ids: ====
06-29 15:54:05.281 1548-1548/test.my.app I/AdColony: ID_ID_ID
06-29 15:54:05.281 1548-1548/test.my.app I/AdColony: ID_ID_ID
06-29 15:54:05.301 1548-1548/test.my.app I/UnityAds: com.unity3d.ads.android.UnityAds.init() (line:474) :: Initializing Unity Ads version 1506 with gameId 1087874
06-29 15:54:05.501 1548-1548/test.my.app I/art: Rejecting re-init on previously-failed class java.lang.Class<com.vungle.publisher.location.GoogleLocationClientDetailedLocationProvider>
06-29 15:54:05.501 1548-1548/test.my.app I/art: Rejecting re-init on previously-failed class java.lang.Class<com.vungle.publisher.location.GoogleLocationClientDetailedLocationProvider>
06-29 15:54:05.501 1548-1548/test.my.app I/art: Rejecting re-init on previously-failed class java.lang.Class<com.vungle.publisher.location.GoogleLocationClientDetailedLocationProvider>
06-29 15:54:05.621 1548-1548/test.my.app W/ResourcesManager: getTopLevelResources: /data/app/com.google.android.gms-2/base.apk / 1.0 running in test.my.app rsrc of package com.google.android.gms
06-29 15:54:05.621 1548-1548/test.my.app D/ResourcesManager: For user 0 new overlays fetched Null
06-29 15:54:05.621 1548-1548/test.my.app I/InjectionManager: Inside getClassLibPath caller 
06-29 15:54:05.621 1548-1548/test.my.app D/DynamitePackage: Instantiating com.google.android.gms.ads.reward.ChimeraRewardedVideoAdCreatorImpl
06-29 15:54:05.631 1548-1548/test.my.app I/Ads: Starting ad request.
06-29 15:54:05.701 1548-1548/test.my.app D/Activity: performCreate Call Injection manager
06-29 15:54:05.701 1548-1548/test.my.app I/InjectionManager: dispatchOnViewCreated > Target : test.my.app.ShowVideoAdActivity isFragment :false
06-29 15:54:05.701 1548-1548/test.my.app I/AdColony: [ADC] AdColony resume called.
06-29 15:54:05.701 1548-1548/test.my.app D/SecWifiDisplayUtil: Metadata value : SecSettings2
06-29 15:54:05.711 1548-1548/test.my.app D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{d300ffa I.E...... R.....ID 0,0-0,0}
06-29 15:54:05.741 1548-1606/test.my.app D/mali_winsys: new_window_surface returns 0x3000,  [1440x2560]-format:1
06-29 15:54:05.761 1548-1548/test.my.app W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
06-29 15:54:05.771 1548-1548/test.my.app D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
06-29 15:54:05.781 1548-1548/test.my.app D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
06-29 15:54:05.781 1548-1548/test.my.app W/cr_ScreenOrientation: Removing an inexistent observer!
06-29 15:54:05.811 1548-1548/test.my.app I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@ae13e3e time:476670117
06-29 15:54:05.841 1548-3294/test.my.app I/UnityAds: com.unity3d.ads.android.webapp.UnityAdsWebData.initCampaigns() (line:223) :: Requesting Unity Ads ad plan from https://impact.applifier.com/mobile/campaigns?platform=android&trackingEnabled=1&advertisingTrackingId=276aa0d53c7c9fa84157df503f26c15c&rawAdvertisingTrackingId=e2ab7fa8-1ff7-4c07-a28b-acfe938efd15&gameId=1087874&sdkVersion=1506&softwareVersion=23&hardwareVersion=samsung+SAMSUNG-SM-G920A&deviceType=268435810&connectionType=wifi&screenSize=268435810&screenDensity=640&encrypted=false
06-29 15:54:05.841 1548-3328/test.my.app I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
06-29 15:54:05.841 1548-3328/test.my.app I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
06-29 15:54:06.001 1548-1561/test.my.app W/Ads: There was a problem getting an ad response. ErrorCode: 0
06-29 15:54:06.001 1548-1548/test.my.app W/Ads: Failed to load ad: 0
06-29 15:54:06.281 1548-3349/test.my.app W/System.err: stat failed: ENOENT (No such file or directory) : nullsession_info.txt
06-29 15:54:06.281 1548-3349/test.my.app W/System.err: stat failed: ENOENT (No such file or directory) : nullzone_state.txt
06-29 15:54:06.291 1548-3349/test.my.app W/System.err: remove failed: ENOENT (No such file or directory) : /data/user/0/test.my.app/files/adc/data/iap_cache.txt
06-29 15:54:06.331 1548-1548/test.my.app D/ViewRootImpl: #3 mView = null
06-29 15:54:06.331 1548-3350/test.my.app I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
06-29 15:54:06.331 1548-3351/test.my.app I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
06-29 15:54:06.331 1548-3350/test.my.app I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
06-29 15:54:06.331 1548-3351/test.my.app I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
06-29 15:54:07.731 1548-1548/test.my.app I/UnityAds: com.unity3d.ads.android.webapp.UnityAdsWebData.campaignDataReceived() (line:684) :: Unity Ads initialized with 19 campaigns and 2 zones
06-29 15:54:07.761 1548-3375/test.my.app I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
06-29 15:54:07.761 1548-3375/test.my.app I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
06-29 15:54:07.891 1548-1548/test.my.app D/cr_Ime: [InputMethodManagerWrapper.java:30] Constructor
06-29 15:54:07.891 1548-1548/test.my.app W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
06-29 15:54:07.891 1548-1548/test.my.app D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
06-29 15:54:07.901 1548-1548/test.my.app I/cr_Ime: ImeThread is not enabled.
06-29 15:54:07.931 1548-1548/test.my.app W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 1548
06-29 15:54:07.931 1548-1548/test.my.app D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
06-29 15:54:08.271 1548-1548/test.my.app I/chromium: [INFO:CONSOLE(8603)] "Resize handler called", source: http://cdn-highwinds.unityads.unity3d.com/impact/webview/production/impact/index.html?version=be098269d319580b55cf71b48f32e4feb030c1ce (8603)
06-29 15:54:08.391 1548-1548/test.my.app I/chromium: [INFO:CONSOLE(8023)] "true", source: http://cdn-highwinds.unityads.unity3d.com/impact/webview/production/impact/index.html?version=be098269d319580b55cf71b48f32e4feb030c1ce (8023)
06-29 15:54:08.421 1548-1548/test.my.app I/chromium: [INFO:CONSOLE(8586)] "Hiding all views", source: http://cdn-highwinds.unityads.unity3d.com/impact/webview/production/impact/index.html?version=be098269d319580b55cf71b48f32e4feb030c1ce (8586)
06-29 15:54:08.431 1548-1548/test.my.app I/chromium: [INFO:CONSOLE(8584)] "Showing: none", source: http://cdn-highwinds.unityads.unity3d.com/impact/webview/production/impact/index.html?version=be098269d319580b55cf71b48f32e4feb030c1ce (8584)
06-29 15:54:20.381 1548-1548/test.my.app I/AdColony: [ADC] AdColony pause called.
06-29 15:54:20.971 1548-1548/test.my.app V/ActivityThread: updateVisibility : ActivityRecord{a9e58fe token=android.os.BinderProxy@ae13e3e {test.my.app/test.my.app.ShowVideoAdActivity}} show : true
06-29 15:54:31.591 1548-3348/test.my.app I/System.out: Exiting monitor

これが私のShowVideoAdActivityファイルのコードです

import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.view.WindowManager;

import com.chartboost.sdk.Chartboost;
import com.google.ads.mediation.admob.AdMobAdapter;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.MobileAds;
import com.google.android.gms.ads.reward.RewardItem;
import com.google.android.gms.ads.reward.RewardedVideoAd;
import com.google.android.gms.ads.reward.RewardedVideoAdListener;
import com.jirbo.adcolony.AdColony;
import com.unity3d.ads.android.IUnityAdsListener;
import com.unity3d.ads.android.UnityAds;
import com.vungle.publisher.VunglePub;
import com.vungle.publisher.EventListener;
import com.vungle.publisher.AdConfig;
import com.vungle.publisher.Orientation;
import com.vungle.publisher.VunglePub;


public class ShowVideoAdActivity extends Activity implements RewardedVideoAdListener, IUnityAdsListener {

    //dialog builder for dialogs
    private AlertDialog.Builder dialog;

    private static final String AD_UNIT_ID = "ca-app-pub-";
    private static final String APP_ID = "ca-app-pub-";

    // get the VunglePub instance
    final VunglePub vunglePub = VunglePub.getInstance();



    private boolean mIsRewardedVideoLoading;
    private RewardedVideoAd mAd;
    private final Object mLock = new Object();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        super.onCreate(savedInstanceState);


        //Keeping screen lights on
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

        //Screen rotation off
        this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);


        AdColony.configure(this, "version:0.1,store:google",
                "id",
                "id");
        AdColony adColony = new AdColony();

        UnityAds.init(this, "id", this);

        // initialize the Publisher SDK
        vunglePub.init(this, "id");
        vunglePub.setEventListeners(vungleDefaultListener, vungleSecondListener);

        Chartboost.startWithAppId(this, "id", "id");
        Chartboost.onCreate(this);


        mAd = MobileAds.getRewardedVideoAdInstance(this);
        mAd.setRewardedVideoAdListener(this);


        loadRewardedVideoAd();

        setContentView(R.layout.activity_show_video_ad);

    }

    private void loadRewardedVideoAd() {
        synchronized (mLock) {
            if (!mIsRewardedVideoLoading && !mAd.isLoaded()) {
                mIsRewardedVideoLoading = true;
                Bundle extras = new Bundle();
                extras.putBoolean("_noRefresh", true);

                AdRequest adRequest = new AdRequest.Builder().addTestDevice("B9E3469F4F5B561227675DC9167EFC16")
                        .addNetworkExtrasBundle(AdMobAdapter.class, extras)
                        .build();
                mAd.loadAd(AD_UNIT_ID, adRequest);
            }
        }
        showRewardedVideo();
    }

    private void showRewardedVideo() {
        if (mAd.isLoaded()) {
            mAd.show();
        }
    }


    @Override
    public void onHide() {

    }

    @Override
    public void onShow() {

    }

    @Override
    public void onVideoStarted() {

    }

    @Override
    public void onVideoCompleted(String s, boolean b) {

    }

    @Override
    public void onFetchCompleted() {

    }

    @Override
    public void onFetchFailed() {
        Snackbar snackbar = Snackbar.make(getWindow().getDecorView().getRootView(),
                "Ad loading failed!!! #1", Snackbar.LENGTH_LONG);

        snackbar.show();
    }

    @Override
    public void onRewardedVideoAdLoaded() {

    }

    @Override
    public void onRewardedVideoAdOpened() {

    }

    @Override
    public void onRewardedVideoStarted() {

    }

    @Override
    public void onRewardedVideoAdClosed() {
        Snackbar snackbar = Snackbar.make(getWindow().getDecorView().getRootView(),
                "Thank you for watching this ad. ", Snackbar.LENGTH_LONG);

        snackbar.show();
    }

    @Override
    public void onRewarded(RewardItem rewardItem) {

    }

    @Override
    public void onRewardedVideoAdLeftApplication() {

    }

    @Override
    public void onRewardedVideoAdFailedToLoad(int i) {
        Snackbar snackbar = Snackbar.make(getWindow().getDecorView().getRootView(),
                "Ad loading failed!!! #2", Snackbar.LENGTH_LONG);

        snackbar.show();
    }





    private final EventListener vungleDefaultListener = new EventListener() {
        @Deprecated
        @Override
        public void onVideoView(boolean isCompletedView, int watchedMillis, int videoDurationMillis) {
            // This method is deprecated and will be removed. Please use onAdEnd() instead.
        }

        @Override
        public void onAdStart() {
            // Called before playing an ad.
        }

        @Override
        public void onAdUnavailable(String reason) {
            // Called when VunglePub.playAd() was called but no ad is available to show to the user.

            Snackbar snackbar = Snackbar.make(getWindow().getDecorView().getRootView(),
                    "Ad loading failed!!! #3", Snackbar.LENGTH_LONG);

            snackbar.show();

            System.out.println("~~");
            System.out.println("~~");
            System.out.println("~~");
            System.out.println("~~");
            System.out.println("1");
            System.out.println(reason);
            System.out.println("~~");
            System.out.println("~~");
            System.out.println("~~");

        }

        @Override
        public void onAdEnd(boolean wasCallToActionClicked) {
            // Called when the user leaves the ad and control is returned to your application.
        }

        @Override
        public void onAdPlayableChanged(boolean isAdPlayable) {
            // Called when ad playability changes.
            final boolean enabled = isAdPlayable;
            runOnUiThread(new Runnable() {
                @Override
                public void run() {

                }
            });
        }
    };

    private final EventListener vungleSecondListener = new EventListener() {
        // Vungle SDK allows for multiple listeners to be attached. This secondary event listener is only
        // going to print some logs for now, but it could be used to Pause music, update a badge icon, etc.
        @Deprecated
        @Override
        public void onVideoView(boolean isCompletedView, int watchedMillis, int videoDurationMillis) {}

        @Override
        public void onAdStart() {}

        @Override
        public void onAdUnavailable(String reason) {
            Snackbar snackbar = Snackbar.make(getWindow().getDecorView().getRootView(),
                    "Ad loading failed!!! #4", Snackbar.LENGTH_LONG);

            snackbar.show();

            System.out.println("~~");
            System.out.println("~~");
            System.out.println("~~");
            System.out.println("~~");
            System.out.println("2");
            System.out.println(reason);
            System.out.println("~~");
            System.out.println("~~");
            System.out.println("~~");

        }

        @Override
        public void onAdEnd(boolean wasCallToActionClicked) {}

        @Override
        public void onAdPlayableChanged(boolean isAdPlayable) {

        }
    };

}
4

1 に答える 1