Android 8/9 crashes


I have lots of reports in Google Play about crashes.
Most of them are on Android 8.
Any ideas what could it be?
Here is a screenshot:

What NDK do you use?

Interesting that 55% of the crashes are two different devices, in fact, it seems like they all are Huawei devices?

I think it’s more about Android 8, cause devices are really different.
I’m using android-ndk-r11c.
Here is another similar crash:

I think that r15c is the latest supported by HXCPP, I think I had issues before with applications crashing when the NDK was too old, but I forget the threshold where it cut off

Ok, I have tried once like with r17c and it was crashing, so I stayed on r11c.
How could I know what is the latest supported NDK version?
I will try r15c and see, thank you!

HXCPP currently expects Android to use GCC and not clang. They removed GCC from the newer NDKs at some point, maybe it was r16

Looks like crash is causing by buggy admob, but I can’t find the way to fix it…

I think I found the criminal. It’s JNI.createMemberField when using on Java nested classes.

Here is the sample project:

The APK:

Runs fine on a tablet with Android 4.3 and Nox but crashes on my phone with Android 8, this is the error:

JNI DETECTED ERROR IN APPLICATION: illegal class name 'test.Foo$Bar'

Sorry for the deleted comments, I got many things wrong there so just wanted to get them out of the ways. :frowning:

Hey Melon!
Thanks for details, I still believe my case is different.
This looks like my case:
I will give it a try, if it doesn’t work, I’ll try your variant.
I also don’t have device with Android 8.0, can’t test it myself, this makes things harder. :slight_smile:

1 Like

Update on my previous discovery.

As usual, I got the syntax for className wrong and blamed it on the poor method. :frowning: Though that incorrect syntax seems to still work in most case so there can be confusion. More details here:

My apologies to @pozirk for taking up the thread with wrong info. :frowning: Hope you found the solution for the issue.

1 Like

No problem, Melon! :slight_smile:
The bug with Admob was my case, I see no more such crashes so far, need some extra days to verify though.
Also, will need to add the patch to Admob extension.

Just discovered there is another bug in admob, this time it’s Android 9.
Temporary fix is here:

Looks like Google cannot make its own software to work properly…

That’s great you found the fixes! Thank you for sharing the info & patching the Admob extension, this will save me down the road.