question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Interstitial] Ad not closed on back button : blocking point for playstore production !

See original GitHub issue

Plugin Version

google_mobile_ads: ^0.12.1+1

Steps to Reproduce

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {

  @override
  Widget build(BuildContext context) {
    return InterstitielPage(
      enabled: true,
      child: Scaffold(
        appBar: AppBar(),
        body: Center(child: Text("This ads will not be closed when back button id pressed (we need to spam it)"),),
      ),
    );
  }
}
import 'package:flutter/material.dart';
import 'package:google_mobile_ads/google_mobile_ads.dart';

class InterstitielPage extends StatefulWidget {
  final Widget child;
  final bool enabled;

  const InterstitielPage({Key key, this.child, this.enabled = true}) : super(key: key);

  @override
  _InterstitielPageState createState() => _InterstitielPageState();
}

class _InterstitielPageState extends State<InterstitielPage> {
  InterstitialAd interstitialAd;

  @override
  void dispose() {
    interstitialAd?.dispose();
    super.dispose();
  }

  @override
  void initState() {
    if (widget.enabled) WidgetsBinding.instance.addPostFrameCallback((_) => getAd());
    super.initState();
  }

  bool get isReady => mounted && WidgetsBinding.instance.lifecycleState == AppLifecycleState.resumed;

  getAd() {
    if (!isReady) return null;
    interstitialAd = InterstitialAd(
      adUnitId: "ca-app-pub-3940256099942544/1033173712",
      listener: AdListener(
        onAdLoaded: (Ad ad) {
          if (isReady) interstitialAd.show();
        },
        onAdClosed: (Ad ad) {
          ad.dispose();
          print('Ad closed.');
        },
        onAdFailedToLoad: (Ad ad, error) {
          ad.dispose();
          print('Ad failed to load: $error');
        },
        onApplicationExit: (Ad ad) => print('Left application.'),
      ),
      request: AdRequest(),
    );
    if (isReady) interstitialAd?.load();
    setState(() {});
  }

  @override
  Widget build(BuildContext context) => widget.child;
}

Expected results:

When i press the back button I would see the interstitial closed. Because of that, PlayStore refuse to publish my app :

Your app is not compliant with the Ad Fraud policy. Ad fraud is strictly prohibited. Ads should not appear after the user has exited the app, or after the user has pressed the back button to exit the app

Not that some of my apps were accepted to production but got the error, maybe next release they will be blocked ! The log & video to well understand the issue.

Actual results:

It persist but disappear after around 10-20 try… Maybe about a timer…

Logs
[   +8 ms] I/Ads     ( 3992): Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("2E9CBE21F7A722_CENSORED_ID_FOR_GUTHUB_ISSUE")) to get test ads on this device.
[  +23 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
[   +1 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->allocateInstance(Ljava/lang/Class;)Ljava/lang/Object; (greylist, linking, allowed)
[   +6 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Llibcore/io/Memory;->peekLong(JZ)J (greylist, reflection, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Llibcore/io/Memory;->pokeLong(JJZ)V (greylist, reflection, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Llibcore/io/Memory;->pokeInt(JIZ)V (greylist, reflection, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Llibcore/io/Memory;->peekInt(JZ)I (greylist, reflection, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Llibcore/io/Memory;->pokeByte(JB)V (greylist, reflection, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Llibcore/io/Memory;->peekByte(J)B (greylist, reflection, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Llibcore/io/Memory;->pokeByteArray(J[BII)V (greylist, reflection, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Llibcore/io/Memory;->peekByteArray(J[BII)V (greylist, reflection, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->arrayBaseOffset(Ljava/lang/Class;)I (greylist,core-platform-api, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->arrayIndexScale(Ljava/lang/Class;)I (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden field Ljava/nio/Buffer;->address:J (greylist, reflection, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, reflection, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, reflection, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, reflection, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, reflection, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, reflection, allowed)
[  +12 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, linking, allowed)
[   +5 ms] I/DynamiteModule( 3992): Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:210890500
[        ] I/DynamiteModule( 3992): Selected remote version of com.google.android.gms.ads.dynamite, version >= 210890500
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
[   +9 ms] I/DynamiteModule( 3992): Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:210890500
[        ] W/Parcel  ( 3992): **** enforceInterface() expected 'com.google.android.gms.ads.clearcut.IClearcut' but read 'com.google.android.gms.gass.internal.clearcut.IClearcut'
[        ] I/DynamiteModule( 3992): Selected remote version of com.google.android.gms.ads.dynamite, version >= 210890500
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[   +2 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
[        ] W/Parcel  ( 3992): **** enforceInterface() expected 'com.google.android.gms.ads.clearcut.IClearcut' but read 'com.google.android.gms.gass.internal.clearcut.IClearcut'
[   +1 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
[        ] I/DynamiteModule( 3992): Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:210890500
[        ] I/DynamiteModule( 3992): Selected remote version of com.google.android.gms.ads.dynamite, version >= 210890500
[  +15 ms] W/tal.my_app_censored_name( 3992): ClassLoaderContext classpath element mismatch. expected=/data/app/com.eg_digital.my_app_censored_names-LJJZ0itP-Vkbpspd0yiobw==/base.apk, found=/data/app/com.eg_digital.my_app_censored_names-9j_X88jfmQkXURtSx6kFJA==/base.apk (PCL[];PCL[/data/app/com.eg_digital.my_app_censored_names-LJJZ0itP-Vkbpspd0yiobw==/base.apk*856532249:/data/app/com.eg_digital.my_app_censored_names-LJJZ0itP-Vkbpspd0yiobw==/base.apk!classes2.dex*333229941:/data/app/com.eg_digital.my_app_censored_names-LJJZ0itP-Vkbpspd0yiobw==/base.apk!classes3.dex*264764970:/data/app/com.eg_digital.my_app_censored_names-LJJZ0itP-Vkbpspd0yiobw==/base.apk!classes4.dex*12996791:/data/app/com.eg_digital.my_app_censored_names-LJJZ0itP-Vkbpspd0yiobw==/base.apk!classes5.dex*449296825:/data/app/com.eg_digital.my_app_censored_names-LJJZ0itP-Vkbpspd0yiobw==/base.apk!classes6.dex*1160111402:/data/app/com.eg_digital.my_app_censored_names-LJJZ0itP-Vkbpspd0yiobw==/base.apk!classes7.dex*312131232:/data/app/com.eg_digital.my_app_censored_names-LJJZ0itP-Vkbpspd0yiobw==/base.apk!classes8.dex*2800897254:/data/app/com.eg_digital.my_app_censored_names-LJJZ0itP-Vkbpspd0yiobw==/base.
[  +11 ms] W/tal.my_app_censored_name( 3992): Found duplicate classes, falling back to extracting from APK : /data/user/0/com.eg_digital.my_app_censored_names/app_pccache/5/7145086C2DF9AD170940815BEFAA500FA517C4D3/pcam.jar
[        ] W/tal.my_app_censored_name( 3992): NOTE: This wastes RAM and hurts startup performance.
[        ] W/tal.my_app_censored_name( 3992): Found duplicated class when checking oat files: 'Lcom/google/errorprone/annotations/CanIgnoreReturnValue;' in /data/app/com.eg_digital.my_app_censored_names-9j_X88jfmQkXURtSx6kFJA==/base.apk!classes3.dex and /data/user/0/com.eg_digital.my_app_censored_names/app_pccache/5/7145086C2DF9AD170940815BEFAA500FA517C4D3/pcam.jar
[        ] W/tal.my_app_censored_name( 3992): 
[        ] I/AudioManager( 3992): In isSpeakerphoneOn(), calling application: com.eg_digital.my_app_censored_names
[   +3 ms] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[        ] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[  +21 ms] W/AdWorker(Defaul( 3992): type=1400 audit(0.0:11298): avc: granted { execute } for path="/data/data/com.eg_digital.my_app_censored_names/app_pccache/5/7145086C2DF9AD170940815BEFAA500FA517C4D3/pcam.jar" dev="sda32" ino=2050239 scontext=u:r:untrusted_app:s0:c192,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c192,c257,c512,c768 tclass=file
[   +4 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[  +44 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
[  +16 ms] W/Ads     ( 3992): Not retrying to fetch app settings
[ +590 ms] D/EgretLoader( 3992): EgretLoader(Context context)
[        ] D/EgretLoader( 3992): The context is not activity
[  +11 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[   +7 ms] D/EgretLoader( 3992): EgretLoader(Context context)
[        ] D/EgretLoader( 3992): The context is not activity
[ +119 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[  +36 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
[  +25 ms] I/tal.my_app_censored_name( 3992): Background concurrent copying GC freed 73449(5345KB) AllocSpace objects, 32(1200KB) LOS objects, 49% free, 6688KB/13MB, paused 2.398ms total 149.740ms
[  +19 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
[ +130 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
[   +1 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[  +15 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[  +40 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
[  +76 ms] I/DynamiteModule( 3992): Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:210890500
[        ] I/DynamiteModule( 3992): Selected remote version of com.google.android.gms.ads.dynamite, version >= 210890500
[   +6 ms] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[  +15 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[  +24 ms] I/Timeline( 3992): Timeline: Activity_launch_request time:9577764
[  +27 ms] I/WonderPush.IAM.Headless( 3992): Removing display event component
[   +3 ms] W/ActivityThread( 3992): handleWindowVisibility: no activity for token android.os.BinderProxy@c73f4d5
[  +16 ms] D/DynamitePackage( 3992): Instantiating com.google.android.gms.ads.ChimeraAdOverlayCreatorImpl
[   +5 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[        ] D/ForceDarkHelper( 3992): updateByCheckExcludeList: pkg: com.eg_digital.my_app_censored_names activity: com.google.android.gms.ads.AdActivity@31cd5b6
[   +5 ms] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[   +8 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[        ] D/ForceDarkHelper( 3992): updateByCheckExcludeList: pkg: com.eg_digital.my_app_censored_names activity: com.google.android.gms.ads.AdActivity@31cd5b6
[        ] D/ForceDarkHelper( 3992): updateByCheckExcludeList: pkg: com.eg_digital.my_app_censored_names activity: com.google.android.gms.ads.AdActivity@31cd5b6
[  +22 ms] I/chatty  ( 3992): uid=10448(com.eg_digital.my_app_censored_names) identical 2 lines
[   +4 ms] D/ForceDarkHelper( 3992): updateByCheckExcludeList: pkg: com.eg_digital.my_app_censored_names activity: com.google.android.gms.ads.AdActivity@31cd5b6
[        ] I/WonderPush.IAM.Headless( 3992): Setting display event component
[   +6 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[  +32 ms] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[  +18 ms] W/ContentCatcher( 3992): Failed to notify a WebView
[        ] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[   +3 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[  +49 ms] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[ +141 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
[        ] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[  +19 ms] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[        ] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[   +1 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[ +256 ms] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[   +2 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[   +1 ms] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[   +1 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[ +256 ms] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[        ] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[ +193 ms] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[   +2 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[ +208 ms] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[   +5 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[ +235 ms] D/ViewRootImpl( 3992): [TouchInput][ViewRootImpl] KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x8, repeatCount=0, eventTime=9579292, downTime=9579292, deviceId=-1, source=0x101, displayId=-1 }
[   +1 ms] D/ViewRootImpl( 3992): [TouchInput][ViewRootImpl] KeyEvent { action=ACTION_UP, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x8, repeatCount=0, eventTime=9579292, downTime=9579292, deviceId=-1, source=0x101, displayId=-1 }
[ +189 ms] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[   +2 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[ +350 ms] D/ViewRootImpl( 3992): [TouchInput][ViewRootImpl] KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x8, repeatCount=0, eventTime=9579836, downTime=9579836, deviceId=-1, source=0x101, displayId=-1 }
[   +3 ms] D/ViewRootImpl( 3992): [TouchInput][ViewRootImpl] KeyEvent { action=ACTION_UP, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x8, repeatCount=0, eventTime=9579836, downTime=9579836, deviceId=-1, source=0x101, displayId=-1 }
[ +465 ms] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[   +2 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[+1613 ms] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[   +6 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[+1773 ms] D/ViewRootImpl( 3992): [TouchInput][ViewRootImpl] KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x8, repeatCount=0, eventTime=9583694, downTime=9583694, deviceId=-1, source=0x101, displayId=-1 }
[        ] D/ViewRootImpl( 3992): [TouchInput][ViewRootImpl] KeyEvent { action=ACTION_UP, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x8, repeatCount=0, eventTime=9583694, downTime=9583694, deviceId=-1, source=0x101, displayId=-1 }
[ +280 ms] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
[   +4 ms] W/tal.my_app_censored_name( 3992): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
[ +283 ms] D/ViewRootImpl( 3992): [TouchInput][ViewRootImpl] KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x8, repeatCount=0, eventTime=9584267, downTime=9584267, deviceId=-1, source=0x101, displayId=-1 }
[   +3 ms] D/ViewRootImpl( 3992): [TouchInput][ViewRootImpl] KeyEvent { action=ACTION_UP, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x8, repeatCount=0, eventTime=9584267, downTime=9584267, deviceId=-1, source=0x101, displayId=-1 }
[+1782 ms] D/AudioManager( 3992): getStreamVolume isRestricted mode = 0
No issue.
[√] Flutter (Channel stable, 2.0.6, on Microsoft Windows [version 10.0.19042.964], locale fr-FR)
    • Flutter version 2.0.6 at C:\Users\censored_for_github_issue\Documents\Softwares\flutter
    • Framework revision 1d9032c7e1 (5 days ago), 2021-04-29 17:37:58 -0700
    • Engine revision 05e680e202
    • Dart version 2.12.3

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at D:\Android\Sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: C:\Users\censored_for_github_issue\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\201.7199119\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.0)
    • Visual Studio at D:\dev
    • Visual Studio Community 2019 version 16.9.31025.194
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 4.1.0)
    • Android Studio at C:\Users\censored_for_github_issue\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\201.7199119
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] IntelliJ IDEA Ultimate Edition (version 2021.1)
    • IntelliJ at C:\Users\censored_for_github_issue\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\211.7142.45
    • Flutter plugin version 56.0.5
    • Dart plugin version 211.7233

[√] Connected device (4 available)
    • Mi 9T (mobile)    • c8d2a7bf • android-arm64  • Android 10 (API 29)
    • Windows (desktop) • windows  • windows-x64    • Microsoft Windows [version 10.0.19042.964]
    • Chrome (web)      • chrome   • web-javascript • Google Chrome 90.0.4430.93
    • Edge (web)        • edge     • web-javascript • Microsoft Edge 89.0.774.77

• No issues found!

https://user-images.githubusercontent.com/37028599/117120537-bbf31580-ad93-11eb-81f3-b295d29a014b.mp4

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:22

github_iconTop GitHub Comments

3reactions
bparrishMinescommented, Jun 1, 2021

@EArminjon I believe the issue you are having is not that the app doesn’t close with the back button, but that InterstitialAd.show() is being called after a user has exited an app. A user can close the Ad by clicking the ‘x’ button at the top.

I believe this is related to following best practices in https://support.google.com/admob/answer/6201362?hl=en. The InterstitialAd should only be showed when a user is transitioning between pages.

2reactions
dvirdcommented, May 20, 2021

Ok but still pretty weird… you can see the code above of the guy who opened this issue. he has the logic you’re speaking about but still getting rejected… how do you explain it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Admob Interstitial ad is not closing when user presses back ...
I have reproduced the issue with Android 10 in Android Studio Emulator (Pixel 2 API 29). Press Back Button when showing Interstitial Ads: ......
Read more >
Interstitial ads | Android
Case study. This guide explains how to integrate interstitial ads into an Android app.
Read more >
why back button is not working on interstitial ads?
i am a blind developer and TalkBack is not handling the X or Close button, and i dont even see it only on...
Read more >
Unity Fake ads work great in editor but not on android or ...
Testing my game in Editor, the ads work great right where they should be but when exported to my android phone and installed...
Read more >
Android how to Integrate Banner and Interstitial Ads in your ...
Interstitial ads are full-screen ads that cover the interface of an app until closed by the user. Basically, they will shown on a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found