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
java.lang.IllegalStateException: destroy must be called on the main UI thread. #22
Comments
Thanks, Jens! We'll get that patched up as soon as possible. Best, On Sep 13, 2016, at 11:32 AM, Jens Driller <notifications@github.commailto:notifications@github.com> wrote: I have spotted the following exception in our error logs: 09-13 16:15:08.719 18368-18377 E/System: java.lang.IllegalStateException: destroy must be called on the main UI thread. The problem seems to be that the AdViewhttps://github.com/appnexus/mobile-sdk-android/blob/master/sdk/src/com/appnexus/opensdk/AdView.java#L304-L313 class overrides its finalize() method to stop the ad fetcher: @OverRide // Just in case, kill the adfetcher's service The JVM does not guarantee which thread will invoke finalize() (see java.lang.Daemons$FinalizerDaemon above) — |
I have spotted the following exception in our error logs:
The problem seems to be that the AdView class overrides its
finalize()
method to stop the ad fetcher:The JVM does not guarantee which thread will invoke
finalize()
(seejava.lang.Daemons$FinalizerDaemon
above)so you would have to ensure you are on the main thread before stopping the ad fetcher.
Or, even better, move it to one of the other, custom lifecycle methods.
The text was updated successfully, but these errors were encountered: