如何解决离开应用程序时,Admob 插页式广告冻结应用程序 (Android)
我在我的 Android 游戏中实施了一个插页式广告。
一切正常。 但是,当我在显示时离开该应用程序,该应用程序会在我返回时冻结并变得无响应。
在不离开的情况下点击广告的 [X] 没有问题。
示例:
- 展示了插页式广告。我点击了“概览”按钮(或者我点击了广告本身,这会带我进入网络浏览器)。
- 返回应用后,应用被冻结,点击屏幕只会产生黑屏。
显示广告的代码。仅在 loadAd 成功时调用。
public void showAd(Context con) {
((SummerBound) con).runOnUiThread(new Runnable() {
@Override
public void run() {
try {
if (mInterstitialAd == null) {
GooglePlayBlueskied.events.add(SummerBound.EVENT_SHOW_AD_FAILED);
Log.e("LOGBLUESKIED","showAd: mInterstitialAd == null");
} else {
if (mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
} else {
GooglePlayBlueskied.events.add(SummerBound.EVENT_SHOW_AD_FAILED);
Log.e("LOGBLUESKIED","showAd: isLoaded = false");
}
}
} catch (Exception e) {
GooglePlayBlueskied.events.add(SummerBound.EVENT_SHOW_AD_FAILED);
Log.e("LOGBLUESKIED","Exception in showAd: " + e.getMessage());
}
}
});
}
日志猫: https://pastebin.com/PfVr3pgy
日志中的异常:
2021-01-30 16:04:30.885 2972-3608/? W/ExifInterface: Invalid image: ExifInterface got an unsupported image format file(ExifInterface supports JPEG and some RAW image formats only) or a corrupted JPEG file to ExifInterface.
java.io.IOException: Invalid byte order: ffff8950
at android.media.ExifInterface.readByteOrder(ExifInterface.java:3121)
at android.media.ExifInterface.isOrfFormat(ExifInterface.java:2437)
at android.media.ExifInterface.getMimeType(ExifInterface.java:2315)
at android.media.ExifInterface.loadAttributes(ExifInterface.java:1753)
at android.media.ExifInterface.<init>(ExifInterface.java:1447)
at com.bumptech.glide.load.d.a.ac.a(SourceFile:4)
at com.bumptech.glide.load.f.b(SourceFile:19)
at com.bumptech.glide.load.d.a.w.a(SourceFile:31)
at com.bumptech.glide.load.d.a.g.a(SourceFile:6)
at com.bumptech.glide.load.b.v.a(SourceFile:13)
at com.bumptech.glide.load.b.m.h(SourceFile:123)
at com.bumptech.glide.load.b.m.a(SourceFile:249)
at com.bumptech.glide.load.b.g.a(SourceFile:38)
at com.bumptech.glide.load.c.o.a(SourceFile:4)
at com.bumptech.glide.load.b.g.a(SourceFile:30)
at com.bumptech.glide.load.b.m.e(SourceFile:82)
at com.bumptech.glide.load.b.m.run(SourceFile:59)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
at com.bumptech.glide.load.b.c.d.run(SourceFile:9)
2021-01-30 16:04:36.941 30340-30340/? D/BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.ads.service.CACHE pkg=com.google.android.gms }
2021-01-30 16:04:37.840 1745-2279/? E/GnssHAL_GnssInterface: gnssSvStatusCb: a: input svInfo.flags is 8
2021-01-30 16:04:37.840 1745-2279/? E/GnssHAL_GnssInterface: gnssSvStatusCb: b: input svInfo.flags is 8
2021-01-30 16:04:38.071 5456-5506/com.blueskied.summerbound W/ConnectionTracker: Exception thrown while unbinding
java.lang.IllegalArgumentException: Service not registered: ls@365d8cb
at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1751)
at android.app.ContextImpl.unbindService(ContextImpl.java:1776)
at android.content.ContextWrapper.unbindService(ContextWrapper.java:741)
at ci.f(:com.google.android.gms.dynamite_measurementdynamite@204714084@20.47.14 (120700-0):1)
at ci.d(:com.google.android.gms.dynamite_measurementdynamite@204714084@20.47.14 (120700-0):2)
at lt.E(:com.google.android.gms.dynamite_measurementdynamite@204714084@20.47.14 (120700-0):9)
at ld.a(:com.google.android.gms.dynamite_measurementdynamite@204714084@20.47.14 (120700-0):3)
at ef.run(:com.google.android.gms.dynamite_measurementdynamite@204714084@20.47.14 (120700-0):3)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at iy.run(:com.google.android.gms.dynamite_measurementdynamite@204714084@20.47.14 (120700-0):5)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。