Frequent Android Crashes

One of the apps I was testing with the pre-launch review crashes. The test device was a Pixel with Android 8.0

01-24 21:02:47.965: I/cr\_LibraryLoader(10900): Expected native library version number "58.0.3029.125", actual native library version number "58.0.3029.125" 01-24 21:02:47.981: W/crash\_dump32(10987): type=1400 audit(0.0:114): avc: denied { search } for name="net.facv.playwater7" dev="sda35" ino=877676 scontext=u:r:crash\_dump:s0:c512,c768 tcontext=u:object\_r:app\_data\_file:s0:c512,c768 tclass=dir permissive=0 01-24 21:02:48.033: I/crash\_dump32(10987): obtaining output fd from tombstoned 01-24 21:02:48.033: I//system/bin/tombstoned(678): received crash request for pid 10643 01-24 21:02:48.036: I/crash\_dump32(10987): performing dump of process 10643 (target tid = 10688) 01-24 21:02:48.036: A/DEBUG(10987): \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* 01-24 21:02:48.037: A/DEBUG(10987): Build fingerprint: 'google/sailfish/sailfish:8.0.0/OPR3.170623.008/4294783:user/release-keys' 01-24 21:02:48.037: A/DEBUG(10987): Revision: '0' 01-24 21:02:48.037: A/DEBUG(10987): ABI: 'arm' 01-24 21:02:48.037: A/DEBUG(10987): pid: 10643, tid: 10688, name: GLThread 61 \>\>\> net.facv.playwater7 \<\<\< 01-24 21:02:48.037: A/DEBUG(10987): signal 11 (SIGSEGV), code 1 (SEGV\_MAPERR), fault addr 0x0 01-24 21:02:48.037: A/DEBUG(10987): Cause: null pointer dereference 01-24 21:02:48.037: A/DEBUG(10987): r0 00000000 r1 fffffd3c r2 c7883f00 r3 00000003 01-24 21:02:48.037: A/DEBUG(10987): r4 e756db70 r5 c7883f00 r6 000513fc r7 00000000 01-24 21:02:48.037: A/DEBUG(10987): r8 02a0e9a0 r9 ca03a610 sl 00000004 fp c77f4900 01-24 21:02:48.037: A/DEBUG(10987): ip c9b4acd0 sp c9b4b1d8 lr e7553f4d pc ca02ff94 cpsr 600f0010 01-24 21:02:48.044: A/DEBUG(10987): backtrace: 01-24 21:02:48.044: A/DEBUG(10987): #00 pc 000a2f94 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libopenal.so 01-24 21:02:48.044: A/DEBUG(10987): #01 pc 00016874 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libopenal.so (alcCreateContext+436) 01-24 21:02:48.045: A/DEBUG(10987): #02 pc 00005ff7 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libalmixer.so (ALmixer\_Init+214) 01-24 21:02:48.045: A/DEBUG(10987): #03 pc 0011de04 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libcorona.so 01-24 21:02:48.045: A/DEBUG(10987): #04 pc 000fce20 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libcorona.so 01-24 21:02:48.045: A/DEBUG(10987): #05 pc 0000cc04 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #06 pc 0001ce18 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #07 pc 0000d050 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #08 pc 00005524 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so (lua\_call+32) 01-24 21:02:48.045: A/DEBUG(10987): #09 pc 000126cc /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #10 pc 0000cc04 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #11 pc 0001c954 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #12 pc 0000d050 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #13 pc 00005524 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so (lua\_call+32) 01-24 21:02:48.045: A/DEBUG(10987): #14 pc 000126cc /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #15 pc 0000cc04 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #16 pc 0001c954 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #17 pc 0000d050 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #18 pc 0000c35c /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #19 pc 0000d1c8 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #20 pc 000055a0 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so (lua\_pcall+88) 01-24 21:02:48.045: A/DEBUG(10987): #21 pc 00006ff8 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #22 pc 0000cc04 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/l ib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #23 pc 0001ce18 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #24 pc 0000d050 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #25 pc 0000c35c /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #26 pc 0000d1c8 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #27 pc 000055a0 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so (lua\_pcall+88) 01-24 21:02:48.045: A/DEBUG(10987): #28 pc 000f59e8 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libcorona.so 01-24 21:02:48.045: A/DEBUG(10987): #29 pc 00089904 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libcorona.so 01-24 21:02:48.045: A/DEBUG(10987): #30 pc 0012fa5c /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libcorona.so 01-24 21:02:48.046: A/DEBUG(10987): #31 pc 0007bad8 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libcorona.so 01-24 21:02:48.046: A/DEBUG(10987): #32 pc 0005262f /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/oat/arm/base.odex (offset 0x2c000)

The full log is here. Video is here.

I am also getting a lot of crashes of this kind (on Android 7.0+):

signal 5 (SIGTRAP), code 1 (TRAP_BRKPT)

base.apk

\*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* pid: 0, tid: 0 \>\>\> com.\*mycompanyname\*.\*myappname\* \<\<\< backtrace: #00 pc 00000000005d02be /data/app/com.android.chrome-2/base.apk

Did anyone have a solution for that?

Best regards,

Bjoern

Dear All,

I am facing a “signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) libcorona.so” crash problem similar to a previous one reported by Sphere Game Studios below.

My GOOGLE PLAY crash details are the following:

 

Samsung Galaxy J1 Mini (j1mini3gxw), 768MB RAM, Android 5.1

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

pid: 0, tid: 0 >>> com.gmail.huzso78.stickball.europeanedition <<<

backtrace:

#00 pc 0000000000030c7c /data/app/com.gmail.huzso78.stickball.europeanedition-1/lib/arm/libcorona.so

#01 pc 000000000002b6e4 /data/app/com.gmail.huzso78.stickball.europeanedition-1/lib/arm/libcorona.so

#02 pc 000000000002e9f8 /data/app/com.gmail.huzso78.stickball.europeanedition-1/lib/arm/libcorona.so (Java_com_ansca_corona_JavaToNativeShim_nativeDone+28)

#03 pc 000000000041cf45 /data/dalvik-cache/arm/data@app@com.gmail.huzso78.stickball.europeanedition-1@base.apk@classes.dex

 

The Corona build is 2017.3145.

Do these lines hint the root problem? Is there a known solution to this issue?

I would highly appreciate any tips or advice. Many thanks in advance!

In the meantime, I will try to reproduce the error (I am not sure whether I can do this, since this kind of problem has not come up so far with my devices despite a long test period).

Kind regards,

Zsolt

For us its easy to replicate these ANR crashes, seems only to happen frequently on Android 7 >

And it crashes right after asking for permissions during a fresh install.

Wow! That’s amazing (for fixing it)! Could you please list plugins which are calling for permissions, or make a sample?

Not sure if you quoted the right post there, as we are having the ANR problems not finding any fixes. But below is our build.settings

settings = { plugins = { ["CoronaProvider.gameNetwork.apple"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, }, --for vungle below ["CoronaProvider.ads.vungle"] = { publisherId = "com.vungle", }, }, orientation = { default = "landscapeRight", supported = {"landscapeLeft", "landscapeRight"} }, iphone = { xcassets = "Images.xcassets", plist = { UIPrerenderedIcon = true, UIStatusBarHidden = true, UIApplicationExitsOnSuspend = false, UILaunchStoryboardName = "LaunchScreen", CFBundleDisplayName = "WOTZ" }, }, android = { largeHeap = true, usesExpansionFile = true, versionCode = "464", usesPermissions = { "android.permission.INTERNET", "android.permission.WRITE\_EXTERNAL\_STORAGE", "com.android.vending.CHECK\_LICENSE" }, } }

 And this is the code in the main.lua calling for the permissions.

-------------------------------------------------------- -- CHECK STORAGE PERMISSION IS GRANTED -------------------------------------------------------- local function isStoragePermissionGranted( grantedAppPermissionsTable ) if grantedAppPermissionsTable then for k,v in pairs( grantedAppPermissionsTable ) do if ( v == "Storage" ) then print( "\*\* Storage permission granted! \*\*" ) return true end end end return false end local function appPermissionsListener( event ) if ( isStoragePermissionGranted( event.grantedAppPermissions ) ) then -- Do stuff requiring storage permission print("\* Storage Permission granted \*") debugLog.text=debugLog.text.."\n STORAGE PERMISSION GRANTED" else -- Handle not having storage permission print("\* Storage Permission NOT granted \*") debugLog.text=debugLog.text.."\n STORAGE PERMISSION NOT GRANTED" end end if ( not isStoragePermissionGranted( system.getInfo( "grantedAppPermissions" ) ) ) then if ( native.canShowPopup( "requestAppPermission" ) ) then -- Request Storage Permission. local options = { appPermission = "Storage", urgency = "Critical", listener = appPermissionsListener, rationaleTitle = "Storage access required", rationaleDescription = "Storage access is required to store your career data. Re-request now?", settingsRedirectTitle = "Alert", settingsRedirectDescription = "Without the ability to store data, this app cannot properly function. Please grant storage access within Settings." } native.showPopup( "requestAppPermission", options ) else -- You need to add a permission in the Storage group to your build.settings. print("\* requestAppPermission NOT compatible, Storage Permission NOT granted \*") end end 

Whether the permissions request is one of the causes of ANRs I am not sure as we don’t actually have a device with android 7.0 or newer, we only got this info from one of our core beta testers in Europe.

We are using Build: 2018.3224, and the same build.settings for both android and ios.

**Apologies, CORRECTION to the build number, for our last android build we used 2018.3222 NOT 2018.3224.**

We use 2018.3224 for our mac osx builds which run fine.

Many thanks Jacques for the info!

I am sharing the excitement along with Vlad – would be great if Corona Staff could make a fix!

As for plugins and permissions, my app is simple:

[lua]

plugins =

    {

        [“plugin.applovin”] =

        {

            publisherId = “com.coronalabs”,

            supportedPlatforms = { android=true }

        },

    },

[/lua]

Based on the plugin’s doc the following permissions are automatically added:

  • “android.permission.INTERNET”
  • “android.permission.ACCESS_NETWORK_STATE”
  • “android.permission.WRITE_EXTERNAL_STORAGE”

I am still trying to replicate the mentioned crash, I would let you know if I succeed…

We have had 486 reports in the last 7 days of this CRASH. PLEASE FIX IT ASAP. (This was posted in another thread, and has not been dealt with in over a week)

 

We really hope this is expedited soon.

 

All of our Corona based apps that have had crash issues have dived in ranking on the google play store. This is the reality of revenue and sales hurt over these crashes.

 

We have unity based apps on the store which don’t have this amount of crash issues. C’mon guys, I realize you have a lot to do, but at the very least, these issues need to be taken care of.

 

java.lang.IllegalStateException :

 

 

at android.app.FragmentManagerImpl.checkStateLoss (FragmentManager.java:1323)

 

at android.app.FragmentManagerImpl.popBackStackImmediate (FragmentManager.java:493)

 

at android.app.Activity.onBackPressed (Activity.java:2304)

 

at android.app.Activity.onKeyUp (Activity.java:2282)

 

at com.ansca.corona.CoronaActivity.onKeyUp (CoronaActivity.java:3482)

 

at android.view.KeyEvent.dispatch (KeyEvent.java:3232)

 

at android.app.Activity.dispatchKeyEvent (Activity.java:2512)

 

at com.ansca.corona.input.RaiseKeyEventTask$1.run (RaiseKeyEventTask.java:90)

 

at android.os.Handler.handleCallback (Handler.java:733)

 

at android.os.Handler.dispatchMessage (Handler.java:95)

 

at android.os.Looper.loop (Looper.java:136)

 

at android.app.ActivityThread.main (ActivityThread.java:5584)

 

at java.lang.reflect.Method.invokeNative (Native Method)

 

at java.lang.reflect.Method.invoke (Method.java:515)

 

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1268)

 

at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1084)

 

at dalvik.system.NativeStart.main (Native Method)

Hey JBean, please, refrain from using ALL CAPS.

Can you reproduce the crash? Do you have any information why it happens? Also, 486 doesn’t mean much. If you have 1m sessions, it’s like 0.05%.

We do not use Fragments or FragmentManager inside Corona which seem to be causing this crashes. Lot of ad networks and other plugins use them. I suggest trying your app, pressing back button and look for the crash while various ads are playing. 

@vlads: Sorry I was copying and pasting something and that happened to be the text that was auto-typing from a prior message. (It somehow copied the same font style as the code I pasted)

I haven’t been able to reproduce the crash on my device.

What I am speculating is that the users are trying to hit the back button to back out of the ads showing up. We are noticing significant delays with the very first ad that shows up from the Applovin plugin (not sure if this is an Applovin thing, or a preload issue)

So what is happening is, when the first ad shows up with Applovin paid plugn, there is a black screen for about 3-4 seconds, then the ad finally appears (This only happens with the first ad) subsequent ads show up as normal.

So what I am speculating due to this issue is that users are possibly tapping the back button to get out of the ad, and there’s no response, and it inadvertently exits out of the app.

I tested the app myself, and unless I repeatedly tap the back button, it does not crash. So I’m not sure if it’s user behavior that’s getting inputted as a crash.

How do we prevent this error from happening then? What is your solution?

Thanks Vlad! Let me know if you have any ideas on how to fix it.

Also, what version of the Applovin SDK is implemented in the paid applovin plugin right now? According to Applovin, the latest SDK version for android is 8.0.0

That latest version is currently out, so hoping that this new one may fix that black screen issue on the first ad impresion, which may inadvertently fix the issue above that I have described.

Can I get full list of plugins you’re using?

@vlads:

Admob paid and Applovin paid are the only 2 plugins we use.

Also, did you guys see this new EU rule for Applovin? They said we now have to indicate this below. Is this something you guys need to add to the plugin, or do we have to specify this in the app itself?

https://www.applovin.com/integration#androidPrivacySettings

Privacy Settings

AppLovin SDK requires that publishers set a flag indicating whether the user has provided opt-in consent for the collection and use of personal data.

If the user has consented, please set the following flag to true.

AppLovinPrivacySettings.setHasUserConsent( true, context );

If the user has not consented, please set the following flag to false.

AppLovinPrivacySettings.setHasUserConsent( false, context );

Additionally, if the user is known to be in an age-restricted category (i.e., under the age of 16) please set the following flag to true.

AppLovinPrivacySettings.setIsAgeRestrictedUser( true, context );

This is something you as the developer will have to code for.

JBean, we’re working on it. Please, refrain from anything but Crashes & ANRs in this thread.

Btw, by plugins, I mean all plugins, not just ad plugins.

So all plugins:

Applovin Paid

Admob Paid

Google iAP 

Those are the 3 plugins we use for all android apps consistently.

Got it on the other topic.

Thank you!

Hey, JBean. While we wasn’t able to figure out which exact thing causes that exception, we put blanket try/catch around pause routine in 3281. This should prevent crashes.

@vlads - thanks for the update.

 

I think I may have figured out the difference between using the back arrow with Corona built apps, and using it with unity built ones.

 

When you tap the “back” button on the device in a corona built app (even the latest build that you guys updated) it immediately exits out of the app.

 

With Unity based apps, tapping the back arrow repeatedly on the device does not allow you to exit the app. You have to physically disable the window in order to exit. This requires using the “recents” button, the one that shows all the windows that were recently open, including apps.

 

I think in order to eliminate any crashes detected by the user using the back arrow, it has to be disabled as a method of exiting the app. Not sure if this makes sense or is feasible, but just something I noticed this morning when testing both Corona and Unity based apps.

 

Is there a way for Corona to hijack the “back” button on a device so that it doesn’t exit out of the app when pressed?

you can easily customize what happens when you press back button on Android. On top of my head, should be something like

[lua]function scene:key(event)
  if event.keyName == “back” then

    … do some stuff here? …
    return true
  end
end
Runtime:addEventListener( “key”, scene )[/lua]

@vlads, we’ll give that a try.

Regarding the Applovin PAID plugin - what version of the Applovin SDK is implemented currently for android and iOS?

It looks like AppLovin paid is using 7.8.6 and was updated April 17, 2018.

Rob