Android 8/9 crashes


#1

Hi!

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:


#2

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?


#3

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


#4

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


#5

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!


#6

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


#8

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


#11

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

Here is the sample project: https://drive.google.com/open?id=1z3TL9WQMM5YyZCOrbo-HVAsRJeu4VvjW

The APK: https://drive.google.com/open?id=1qdt-CCbJqCENXWXdYusmWjnEiHvDHKkW

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:


#12

Hey Melon!
Thanks for details, I still believe my case is different.
This looks like my case: https://stackoverflow.com/questions/53370752/activity-crashing-with-java-lang-illegalstateexception
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:


#13

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: https://github.com/openfl/lime/issues/1295

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


#14

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.


#15

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…


#16

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