Crash on Android on AdView.pause()
See original GitHub issueDescribe the bug I received a crashlytics error in production. The error was the following:
Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'void com.google.android.gms.ads.AdView.pause()' on a null object reference
To Reproduce It’s actually hard to reproduce as this is just a crash which was reported by crashlytics.
Expected behavior The app should not crash 😊
Smartphone (please complete the following information):
- Device: Samsung Galaxy J7
- OS: Android 9
Additional context I just wanted to make sure, that every step is taken to prevent that error. It should not be the case, that the app crashes after calling pause.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
setVisibility(View.GONE) causes a Crash - Stack Overflow
OK, done that adView.destroy() is hashed out and adView.setVisibility(View.GONE); remains, but it crashes on the setVisibility .
Read more >AdView Android 13 beta crash [240449675] - Issue Tracker
Every time AdView.loadAd() is called my app crashes with an alert "android services library keeps stopping". The stack-trace for this bug ...
Read more >App crashes when resuming - java.lang.IllegalStateException ...
Describe the bug Admob shows banner ad without issues. But when app is resumed from background, the app crashes. The following is the...
Read more >Admob banner ad crash on Android 8.0 - Google Groups
hello, I've received over ten thousand admob banner crash events in firebase since Oct 2019. ... String.intern()' on a null object reference.
Read more >Random crashes caused by Ads on Android - Unity Forum
I was experiencing frequent crash due to AdMob on android and it was related to ... state of the ads back down when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I took a quick look at the code from my phone. There are two problems that I see. One from the plugin, and one (maybe) from your side.
The plugin code handle correctly requests done when the plugin is not initialized, but it asumes that the consumer will never call
hideBanner
beforeshowBanner
.That last part is the error in your part, probably because of a race condition, you are hiding a banner that was never show.
I will try to handle hide calls of non showed banners this week.
Perfect. Thank you!