Alarming increase of ANRs and Crashes on Android when using new Ad Networks Plug-ins

Hi,

We’ve shipped an update to one of our popular apps and included several new networks: FB audience, Applovin & Adbuddiz. We also have from prev version Vungle and Admob which from past experience are quite robust. In the last 4 days since the update went live, we are seeing an alarming increase in ANRs and Crashes on our Android version. 

This is the graph of errors we see:

 

Anyone using these can let us know if they are seeing similar issues? If not, would love to get tips on how best to use them. For the time being, we will disable them.

Does it provide more info on crashes? What android version or devices?

We have dump files for most. I’ve sent Danny by mail some highlights.

Its on various devices, some of them quite common such as Samsung, LG etc.

Its also on various android versions.

I can update that after disabling FB Audience and AdBuddiz, number of reported errors in the last day dropped from over 60 to 24. Our normal daily error rate is around 10. I would focus on these two.

That being said, we still see crashes also for applovin:

java.lang.NullPointerException
plugin.applovin.LuaLoader.resetInterstitialAd(LuaLoader.java:652)
plugin.applovin.LuaLoader.onResumed(LuaLoader.java:1228)
com.ansca.corona.CoronaEnvironment$RuntimeEventHandler.onResumed(CoronaEnvironment.java:458)
com.ansca.corona.CoronaRuntime.onResumed(CoronaRuntime.java:402)
com.ansca.corona.NativeToJavaBridge.callOnRuntimeResumed(NativeToJavaBridge.java:437)
com.ansca.corona.JavaToNativeShim.nativeResume(Native Method)
com.ansca.corona.JavaToNativeShim.resume(JavaToNativeShim.java:149)
com.ansca.corona.Controller.updateRuntimeState(Controller.java:293)
com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:421)
com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1623)
com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1378)

I’m getting a few new crashes too after my latest app update (on Android) built with 2016.2846 on OSX 10.11.4.

The only change in my app was adding (and using just a little) Google Analytics plugin.

This is the error I get from GA:

NullPointerException (@CoronaSensorManager:stopType:888) {main}

I’ll investigate more.

Update:

I found the cause and a fix: nothing to do with Google Analytics but somehow with AdMob. The crash occurred in a call to ads.hide() when the user pressed the back button on device.

I suspect that ads.hide was called improperly, maybe twice, thus causing the crash.

It might be because i’m hiding ads on both applicationExit and applicationSuspend events.

I’ll try to learn more abut these systemEvents on Android to better pinpoint the issue…

Sorry if these info might not be exactly related to this thread. It was not my intention to hijack…

 local function onSystemEvent( event ) local self = \_G.afk.ads if event.type == "applicationExit" or event.type == "applicationSuspend" then -- Hide banners on suspend self:stopAds() elseif event.type == "applicationResume" then -- resume banners self:resumeAds() end print( "System event name and type: " .. event.name, event.type ) end Runtime:addEventListener( "system", onSystemEvent ) end function adLib:stopAds() -- Adding this check fixed the Back Button Crash if self.adsRunning == true then ads.hide() end self.adsRunning = false end --------------------------------------------------------------------------------

Thanks for the info.

I’m looking at both FAN and Applovin today and will update with my findings

The Facebook Audience Network and Applovin issues should now be fixed.

Let me know if that isn’t the case. Regarding the ANR’s and other crash that was unrelated to the above plugins, if you would file a bug report for those, it would be most appreciated.

Thank you

Thanks Danny,

I will issue a bug with the ANRs and crashes we still get. Thanks for the effort. I’ll also update on the performance of the plug-ins after the fix once they go live.

Does it provide more info on crashes? What android version or devices?

We have dump files for most. I’ve sent Danny by mail some highlights.

Its on various devices, some of them quite common such as Samsung, LG etc.

Its also on various android versions.

I can update that after disabling FB Audience and AdBuddiz, number of reported errors in the last day dropped from over 60 to 24. Our normal daily error rate is around 10. I would focus on these two.

That being said, we still see crashes also for applovin:

java.lang.NullPointerException
plugin.applovin.LuaLoader.resetInterstitialAd(LuaLoader.java:652)
plugin.applovin.LuaLoader.onResumed(LuaLoader.java:1228)
com.ansca.corona.CoronaEnvironment$RuntimeEventHandler.onResumed(CoronaEnvironment.java:458)
com.ansca.corona.CoronaRuntime.onResumed(CoronaRuntime.java:402)
com.ansca.corona.NativeToJavaBridge.callOnRuntimeResumed(NativeToJavaBridge.java:437)
com.ansca.corona.JavaToNativeShim.nativeResume(Native Method)
com.ansca.corona.JavaToNativeShim.resume(JavaToNativeShim.java:149)
com.ansca.corona.Controller.updateRuntimeState(Controller.java:293)
com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:421)
com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1623)
com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1378)

I’m getting a few new crashes too after my latest app update (on Android) built with 2016.2846 on OSX 10.11.4.

The only change in my app was adding (and using just a little) Google Analytics plugin.

This is the error I get from GA:

NullPointerException (@CoronaSensorManager:stopType:888) {main}

I’ll investigate more.

Update:

I found the cause and a fix: nothing to do with Google Analytics but somehow with AdMob. The crash occurred in a call to ads.hide() when the user pressed the back button on device.

I suspect that ads.hide was called improperly, maybe twice, thus causing the crash.

It might be because i’m hiding ads on both applicationExit and applicationSuspend events.

I’ll try to learn more abut these systemEvents on Android to better pinpoint the issue…

Sorry if these info might not be exactly related to this thread. It was not my intention to hijack…

 local function onSystemEvent( event ) local self = \_G.afk.ads if event.type == "applicationExit" or event.type == "applicationSuspend" then -- Hide banners on suspend self:stopAds() elseif event.type == "applicationResume" then -- resume banners self:resumeAds() end print( "System event name and type: " .. event.name, event.type ) end Runtime:addEventListener( "system", onSystemEvent ) end function adLib:stopAds() -- Adding this check fixed the Back Button Crash if self.adsRunning == true then ads.hide() end self.adsRunning = false end --------------------------------------------------------------------------------

Thanks for the info.

I’m looking at both FAN and Applovin today and will update with my findings

The Facebook Audience Network and Applovin issues should now be fixed.

Let me know if that isn’t the case. Regarding the ANR’s and other crash that was unrelated to the above plugins, if you would file a bug report for those, it would be most appreciated.

Thank you

Thanks Danny,

I will issue a bug with the ANRs and crashes we still get. Thanks for the effort. I’ll also update on the performance of the plug-ins after the fix once they go live.