admobadapter icon indicating copy to clipboard operation
admobadapter copied to clipboard

Fatal Exception: java.lang.IllegalStateException

Open lpbas opened this issue 7 years ago • 4 comments

Admobadapter version or commit: Latest (v1.4.6)

Android compileSdkVersion: 27

Issue description briefly: After deploying the library on my app, I get the following exception:

Fatal Exception: java.lang.IllegalStateException
The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. Make sure your adapter calls notifyDataSetChanged() when its content changes. [in ListView(2131296540, class android.widget.ListView) with Adapter(class com.clockbyte.admobadapter.bannerads.AdmobBannerAdapterWrapper)]

Steps to reproduce: I have not been able to reproduce this locally, so I do not know how to reproduce this.

I'm trying to figure out if this is a problem with the library, the ads, or my original adapter. Please keep in mind that I never got a crash report regarding my adapters before adding the admobAdapterWrapper in my app, and that's why I dont think it has to do with my adapter.

If you have any ideas/suggestions, please let me know.

lpbas avatar Apr 03 '18 09:04 lpbas

@L4grange please pay attention to all the places where you get a response from your webservice (or something) and try to update results to your adapter (wrapped with banner wrapper adapter). Do you update it in the UI thread (as error message suggests)? Could you please make some test project to reproduce it and share with me?

kot331107 avatar Apr 03 '18 11:04 kot331107

Unfortunately I can't reproduce the issue locally, this is comming from my crashlytics crash reports. I will go tomorrow over every single adapter notificaiton and make sure once again.

As I've seen your code, I know that all your calls to notifyDataStateChanged() are on the main thread, I'm trying to figure out what's wrong with my adapters combined with the admobWrapper.

I will let you know when I have more info, thank you for your help!

lpbas avatar Apr 03 '18 14:04 lpbas

@L4grange Hi, Okay, waiting for your update :)

kot331107 avatar Apr 04 '18 08:04 kot331107

I am getting the same error: java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. Make sure your adapter calls notifyDataSetChanged() when its content changes. [in ListView(2131230874, class android.widget.ListView) with Adapter(class com.clockbyte.admobadapter.bannerads.AdmobBannerAdapterWrapper)]

Steps to reproduce:

It's kind of hard to reproduce:

  1. Fling/scroll listview super fast
  2. Stop scroll suddenly at an area where adview will appear
  3. Click a listitem quickly before adview appears

I am using the admob mediation with facebook ads so this could have something to do with it.

HaydenCampbell avatar Dec 23 '18 06:12 HaydenCampbell