An Android application, which uses Native Shared libraries (via JNI), runs correctly on Any Android device.
It has a point in code, where a NullPointerExcetion
might be thrown,
For example:
1. Attempt to invoke interface method 'java.lang.String java.security.PrivateKey.getFormat()' on a null object reference
2. kjava.lang.NullPointerException: Attempt to get length of null array
in Most of the devices and different versions of Android devices, the thrown exception is trapped and handled - and the application continues running.
BUT: on certain Android devices (e.g. Sony Xperia Z3+), the application crashes due to Signal 11 - after the Native Code is initialized and executed (via JNI).
If the JNI
code was not executed - the NullPointerException
is thrown and correctly handled.
Once the JNI
code is executed, the application would crash on Signal 11 instead of getting the Java Exception.
My questions: have some of you experienced that behavior - Process Signal instead of Java
Exception
?
Is there a way to avoid that?
Again, please note that the issue was only detected on Android 5 devices!
Thanks!!