Android crash report in Chartboost plugin (NullPointerException)

Recently I found some crash reports from Google Play, indicating the crash is in Chartboost plugin as below:

java.lang.NullPointerException at plugin.chartboost.cache$1.run(cache.java:132) at android.os.Handler.handleCallback(Handler.java:800) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5433) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:924) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691) at dalvik.system.NativeStart.main(Native Method)

Hope this can provide some clue for you to fix the crash. (The crash above is with Chartboost version 1.3. Not sure if this happens in 1.41)

Thanks for the information Joe. Appreciate it.

Will take a look at that and see if there is anything suspicious going on.

Thanks

Joe, can you give me some examples of the way you are using chartboost.cache()?

Are you passing in locations? If so can you give me some examples of how your function calls look? 

It would be great if we narrow this down into a small example that did it every time. That’s probably a pipe dream for us right now though :slight_smile:

Thanks

Joe, based on your crash report… I think I have found the issue. It appears that a race condition could happen under certain circumstances. This was causing the Chartboost instance to be a null pointer, and thus, the above crash report you have shown could have happened to any of the Chartboost methods (bar init).

I presume the reason this was caught on cache for you, is that cache was the first chartboost method bar init that you called.

I have pushed up a fix, and the fix will be live within 1.5 hours of this post.

Thanks for the information Joe. Appreciate it.

Will take a look at that and see if there is anything suspicious going on.

Thanks

Joe, can you give me some examples of the way you are using chartboost.cache()?

Are you passing in locations? If so can you give me some examples of how your function calls look? 

It would be great if we narrow this down into a small example that did it every time. That’s probably a pipe dream for us right now though :slight_smile:

Thanks

Joe, based on your crash report… I think I have found the issue. It appears that a race condition could happen under certain circumstances. This was causing the Chartboost instance to be a null pointer, and thus, the above crash report you have shown could have happened to any of the Chartboost methods (bar init).

I presume the reason this was caught on cache for you, is that cache was the first chartboost method bar init that you called.

I have pushed up a fix, and the fix will be live within 1.5 hours of this post.