Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Exception: java.lang.IllegalStateException #119

Open
lpbas opened this issue Apr 3, 2018 · 4 comments
Open

Fatal Exception: java.lang.IllegalStateException #119

lpbas opened this issue Apr 3, 2018 · 4 comments

Comments

@lpbas
Copy link
Contributor

lpbas commented Apr 3, 2018

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.

@kot331107
Copy link
Contributor

kot331107 commented Apr 3, 2018

@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?

@lpbas
Copy link
Contributor Author

lpbas commented Apr 3, 2018

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!

@kot331107
Copy link
Contributor

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

@HaydenCampbell
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants