AppLovin crashed my app when closing it

I have integrated AppLovin into our app, and after calling:

native.requestExit()

I got the following crash on my Android device:

W/System.err(16717): java.lang.NullPointerException: Attempt to invoke interface method ‘boolean java.util.Map.containsKey(java.lang.Object)’ on a null object reference

W/System.err(16717):    at plugin.applovin.LuaLoader$AdLoadListener.adReceived(LuaLoader.java:362)

W/System.err(16717):    at com.applovin.impl.sdk.ac.run(Unknown Source)

W/System.err(16717):    at android.os.Handler.handleCallback(Handler.java:739)

W/System.err(16717):    at android.os.Handler.dispatchMessage(Handler.java:95)

W/System.err(16717):    at android.os.Looper.loop(Looper.java:145)

W/System.err(16717):    at android.app.ActivityThread.main(ActivityThread.java:5832)

W/System.err(16717):    at java.lang.reflect.Method.invoke(Native Method)

W/System.err(16717):    at java.lang.reflect.Method.invoke(Method.java:372)

W/System.err(16717):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)

W/System.err(16717):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

This doesn’t reproduce every time, but if it happened to me, it will happen to our users, and we can’t take that chance. 

Can you please sort it out?

Can I get you to submit a bug report please? You will need a simple project that demonstrates the problem. It must have a main.lua, config.lua and the build.setttings needed to run the plugin and produce the crash. Also include any assets needed to run the app. In other words an engineer should be able to take the project, load it in the simulator hit the build for device screen and run it on the device and see the issue. Put all of that in a .zip file and use the “Report a Bug” feature at the top of the page.

You will get a confirmation email that contains a CaseID, please post that back here please.

Thanks

Rob

I can’t submit a bug report because this issue doesn’t reproduce every time, but the stack trace should be enough to see where the problem is.

Thanks

I’ll look into this.

What device/firmware was this on out of curiosity? 

This happened on an Android device (Samsung Galaxy S2, OS version 4.3.1)

Thanks. I’ll report back shortly

Hey Stange.

This issue should be fixed now.

The updated version of the plugin will be available from 1~2 hours from the time of this post.

Let me know how you get on.

Have a good weekend

Great to hear, thank you!

Hi Danny, I’m actually experiencing the same issue with the AppLovin plugin. It’s crashing my app every single time it exits:

07-27 17:34:04.273: E/AndroidRuntime(25986): FATAL EXCEPTION: main 07-27 17:34:04.273: E/AndroidRuntime(25986): Process: com.quiztix.myapp, PID: 25986 07-27 17:34:04.273: E/AndroidRuntime(25986): java.lang.RuntimeException: Unable to destroy activity {com.quiztix.myapp/com.ansca.corona.CoronaActivity}: java.lang.NullPointerException 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3683) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3701) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.app.ActivityThread.access$1500(ActivityThread.java:161) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1318) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.os.Handler.dispatchMessage(Handler.java:102) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.os.Looper.loop(Looper.java:157) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.app.ActivityThread.main(ActivityThread.java:5356) 07-27 17:34:04.273: E/AndroidRuntime(25986): at java.lang.reflect.Method.invokeNative(Native Method) 07-27 17:34:04.273: E/AndroidRuntime(25986): at java.lang.reflect.Method.invoke(Method.java:515) 07-27 17:34:04.273: E/AndroidRuntime(25986): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265) 07-27 17:34:04.273: E/AndroidRuntime(25986): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) 07-27 17:34:04.273: E/AndroidRuntime(25986): at dalvik.system.NativeStart.main(Native Method) 07-27 17:34:04.273: E/AndroidRuntime(25986): Caused by: java.lang.NullPointerException 07-27 17:34:04.273: E/AndroidRuntime(25986): at plugin.applovin.LuaLoader.onExiting(LuaLoader.java:1391) 07-27 17:34:04.273: E/AndroidRuntime(25986): at com.ansca.corona.CoronaEnvironment$RuntimeEventHandler.onExiting(CoronaEnvironment.java:521) 07-27 17:34:04.273: E/AndroidRuntime(25986): at com.ansca.corona.CoronaRuntime.onExiting(CoronaRuntime.java:430) 07-27 17:34:04.273: E/AndroidRuntime(25986): at com.ansca.corona.CoronaRuntime.dispose(CoronaRuntime.java:76) 07-27 17:34:04.273: E/AndroidRuntime(25986): at com.ansca.corona.CoronaActivity.onDestroy(CoronaActivity.java:1505) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.app.Activity.performDestroy(Activity.java:5598) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1135) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3670) 07-27 17:34:04.273: E/AndroidRuntime(25986): ... 11 more

Although I’m an Enterprise user, this particular app is built using the SDK so is downloading the plugin via build.settings.

Thanks Alan.

I’ll see if I can reproduce this and get back to you.

Cheers. I forgot to mention it’s on Android (Galaxy S4).

Edit: Though I’m sure you would have realised that from the Java errors. It’s been a long day…

Thank you for the report.

This issue has been fixed and an updated version of the plugin has been submitted to the build server.

This process can take 1>2 hours to complete, so if you build again after 1>2 hours from the time of this post, you will have the latest version.

Let me know how you get on.

Thank you.

Can I get you to submit a bug report please? You will need a simple project that demonstrates the problem. It must have a main.lua, config.lua and the build.setttings needed to run the plugin and produce the crash. Also include any assets needed to run the app. In other words an engineer should be able to take the project, load it in the simulator hit the build for device screen and run it on the device and see the issue. Put all of that in a .zip file and use the “Report a Bug” feature at the top of the page.

You will get a confirmation email that contains a CaseID, please post that back here please.

Thanks

Rob

I can’t submit a bug report because this issue doesn’t reproduce every time, but the stack trace should be enough to see where the problem is.

Thanks

I’ll look into this.

What device/firmware was this on out of curiosity? 

This happened on an Android device (Samsung Galaxy S2, OS version 4.3.1)

Thanks. I’ll report back shortly

Hey Stange.

This issue should be fixed now.

The updated version of the plugin will be available from 1~2 hours from the time of this post.

Let me know how you get on.

Have a good weekend

Great to hear, thank you!

Hi Danny, I’m actually experiencing the same issue with the AppLovin plugin. It’s crashing my app every single time it exits:

07-27 17:34:04.273: E/AndroidRuntime(25986): FATAL EXCEPTION: main 07-27 17:34:04.273: E/AndroidRuntime(25986): Process: com.quiztix.myapp, PID: 25986 07-27 17:34:04.273: E/AndroidRuntime(25986): java.lang.RuntimeException: Unable to destroy activity {com.quiztix.myapp/com.ansca.corona.CoronaActivity}: java.lang.NullPointerException 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3683) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3701) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.app.ActivityThread.access$1500(ActivityThread.java:161) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1318) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.os.Handler.dispatchMessage(Handler.java:102) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.os.Looper.loop(Looper.java:157) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.app.ActivityThread.main(ActivityThread.java:5356) 07-27 17:34:04.273: E/AndroidRuntime(25986): at java.lang.reflect.Method.invokeNative(Native Method) 07-27 17:34:04.273: E/AndroidRuntime(25986): at java.lang.reflect.Method.invoke(Method.java:515) 07-27 17:34:04.273: E/AndroidRuntime(25986): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265) 07-27 17:34:04.273: E/AndroidRuntime(25986): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) 07-27 17:34:04.273: E/AndroidRuntime(25986): at dalvik.system.NativeStart.main(Native Method) 07-27 17:34:04.273: E/AndroidRuntime(25986): Caused by: java.lang.NullPointerException 07-27 17:34:04.273: E/AndroidRuntime(25986): at plugin.applovin.LuaLoader.onExiting(LuaLoader.java:1391) 07-27 17:34:04.273: E/AndroidRuntime(25986): at com.ansca.corona.CoronaEnvironment$RuntimeEventHandler.onExiting(CoronaEnvironment.java:521) 07-27 17:34:04.273: E/AndroidRuntime(25986): at com.ansca.corona.CoronaRuntime.onExiting(CoronaRuntime.java:430) 07-27 17:34:04.273: E/AndroidRuntime(25986): at com.ansca.corona.CoronaRuntime.dispose(CoronaRuntime.java:76) 07-27 17:34:04.273: E/AndroidRuntime(25986): at com.ansca.corona.CoronaActivity.onDestroy(CoronaActivity.java:1505) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.app.Activity.performDestroy(Activity.java:5598) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1135) 07-27 17:34:04.273: E/AndroidRuntime(25986): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3670) 07-27 17:34:04.273: E/AndroidRuntime(25986): ... 11 more

Although I’m an Enterprise user, this particular app is built using the SDK so is downloading the plugin via build.settings.