Not logging ad exposure. No active activity. 'Google Admob RewardedVideo'

Viewed 981

I get an error when I want to switch to another activity. The problem started right now: 'Google Admob RewardedVideo' I was trying to add. There was no problem after adding the flag ad.

23198-23236/com.metabrain.emre V/FA: Recording user engagement, ms: 46984

23198-23236/com.metabrain.emre V/FA: Activity paused, time: 84767609

23198-23236/com.metabrain.emre V/FA: Not logging ad unit exposure. No active activity

23198-23236/com.metabrain.emre V/FA: Not logging ad exposure. No active activity

Info:

21105-21105/? W/IInputConnectionWrapper: showStatusIcon on inactive InputConnection

18621-18621/? I/FA: App measurement is starting up, version: 10084

18621-18621/? I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE

18621-18621/? I/FA: To enable faster debug mode event logging run: adb shell setprop debug.firebase.analytics.app com.ext.ui

18276-18484/? I/FA-SVC: App measurement is starting up, version: 11302

18276-18674/? I/FA-SVC: This instance being marked as an uploader

19034-19034/com.metabrain.emre I/FA: App measurement is starting up, version: 11020

19034-19034/com.metabrain.emre I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE

19034-19034/com.metabrain.emre I/FA: To enable faster debug mode event logging run: adb shell setprop debug.firebase.analytics.app com.metabrain.emre

19034-19069/com.metabrain.emre I/FA: Tag Manager is not found and thus will not be used

Verbose:

08-13 15:05:14.959 19034-19069/com.metabrain.emre I/FA: Tag Manager is not found and thus will not be used 08-13 15:05:14.992 19034-19069/com.metabrain.emre D/FA: Logging event (FE): ad_query(_aq), Bundle[{firebase_event_origin(_o)=am, ad_event_id(_aeid)=-949480578009143333}] 08-13 15:05:15.041 19034-19069/com.metabrain.emre V/FA: Using measurement service 08-13 15:05:15.041 19034-19069/com.metabrain.emre V/FA: Connection attempt already in progress 08-13 15:05:15.043 19034-19069/com.metabrain.emre D/FA: Logging event (FE): ad_query(_aq), Bundle[{firebase_event_origin(_o)=am, ad_event_id(_aeid)=-949480578009143354}] 08-13 15:05:15.057 19034-19069/com.metabrain.emre V/FA: Using measurement service 08-13 15:05:15.057 19034-19069/com.metabrain.emre V/FA: Connection attempt already in progress 08-13 15:05:15.085 19034-19069/com.metabrain.emre V/FA: Using measurement service 08-13 15:05:15.085 19034-19069/com.metabrain.emre V/FA: Connection attempt already in progress 08-13 15:05:15.087 19034-19069/com.metabrain.emre D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=Main_Activity, firebase_screen_id(_si)=-949480578009143353}] 08-13 15:05:15.101 19034-19069/com.metabrain.emre V/FA: Using measurement service 08-13 15:05:15.101 19034-19069/com.metabrain.emre V/FA: Connection attempt already in progress 08-13 15:05:15.105 19034-19069/com.metabrain.emre V/FA: Activity resumed, time: 83370181 08-13 15:05:15.270 19034-19069/com.metabrain.emre V/FA: Screen exposed for less than 1000 ms. Event not sent. time: 184 08-13 15:05:15.270 19034-19069/com.metabrain.emre V/FA: Using measurement service 08-13 15:05:15.270 19034-19069/com.metabrain.emre V/FA: Connection attempt already in progress 08-13 15:05:15.272 19034-19069/com.metabrain.emre V/FA: Activity paused, time: 83370365 08-13 15:05:15.306 19034-19069/com.metabrain.emre D/FA: Logging event (FE): app_exception(_ae), Bundle[{firebase_event_origin(_o)=crash, timestamp=1502625915299, fatal=1}] 08-13 15:05:15.324 19034-19069/com.metabrain.emre V/FA: Using measurement service 08-13 15:05:15.324 19034-19069/com.metabrain.emre V/FA: Connection attempt already in progress

Dependencies:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
        compile 'com.google.firebase:firebase-core:11.0.4'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.google.firebase:firebase-ads:11.0.4'
    compile 'com.google.firebase:firebase-crash:11.0.4'
    ...
    testCompile 'junit:junit:4.12'
    compile "com.google.android.gms:play-services-games:11.0.4"
    compile 'com.android.support:multidex:1.0.1'
    compile project(path: ':BaseGameUtils')
}
1 Answers

I had faced an issue like this with interstitial ads, and found that the user is trying to leave the activity while there is an interstitial add which is already loaded but not shown to the user yet. and I had solved the issue in the following manner:

  1. Define a Boolean flag:

    private boolean addIsReady;
  2. Set the flag status inside the adListener class when you load your ad:

    myAd.setAdListener(new AdListener() {
             @Override
             public void onAdLoaded() {
                 addIsReady = true;
             }
    
             @Override
             public void onAdFailedToLoad(int errorCode) {
                 addIsReady = false;
             }
     }
  3. set the flag to false just before showing your ad to the user inside a method like this:

    void showInterstitialAd(){
      if (mmAd == null) return;
         if (myAd.isLoaded()) {
             addIsReady = false;
             myAd.show();
         }
     }
  4. check if the is already loaded before the user leaves the activity and if it's true show the already loaded ad to the user (this step solved the issue in my case)

    @Override
    public void onBackPressed() {
        if (addIsReady){
            requiredLawIndex = -1;
            showInterstitialAd();
        }
        super.onBackPressed();
    }
    

I hope this answer could help you.

Related