-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JNI Error in Android #817
Comments
Ok |
You're trying to deserliaze a type which has a Lock which can't be On Mon, Mar 28, 2016, 10:56 AM Alex Ironz notifications@github.com wrote:
|
The catch here is there is no exception while running the app in some Regards, On Mon, Mar 28, 2016 at 8:31 PM, Jake Wharton notifications@github.com
|
It seems to behaves differently based on the underlying Android implementation, I used a simple test app: public interface A {
void method();
}
...
UnsafeAllocator unsafeAllocator = UnsafeAllocator.create();
Log.d(TAG, "Try to allocate interface");
A a = null;
try {
a = unsafeAllocator.newInstance(A.class);
} catch (Exception e) {
Log.e(TAG, "", e);
}
Log.d(TAG, "Try to call a method on allocated interface");
a.method();
Log.d(TAG, "Method called");
... On Nexus 5X running Android N preview 1 that would cause VM to abort and report JNI error, then try to restart the app and immediately crash again entering a infinite loop
But on Nexus 5 running Android 5.1.1, instantiation would succeed, while a method call would cause a segmentation fault
While on LG D772 (G3 mini or something like that running 4.4.2) it actually threw the exception
Unfortunately I don't have a device running Marshmallow to test on currently While I completely agree that either a transient modifier or a TypeAdapter implementation is the right solution for this problem, maybe adding a check if the class modifiers contain interface or abstract and throwing a RuntimeException could help spotting this kind of issue quicker. Especially on some versions of Android where the only feedback would be a segmentation fault. |
Check if class can be instantiated based on class modifiers. Fix for #817
Hello guys. I am also facing similar issue. App crashes only on specific device. I am running my code on MotoG2 and it crashed with following error.
However, I ran the same on my emulator(Nexus 5) and I runs perfectly. Kindly share what I am missing. Thanks! |
I have similiar error when change connection wifi to simcard. |
Check if class can be instantiated based on class modifiers. Fix for google#817
I am facing similar error. My gson version is 2.8.6 and My Android App crashes in only one user who use OPPO Reno. It crashed with following error. Can someone help me? #00 pc 00000000004dc048 /data/app/com.coloros.gallery3d-8UnmKogdiRn8BbCBUHwcSg==/oat/arm64/base.odex (com.google.gson.internal.UnsafeAllocator.create+1192) |
I am getting a 'JNI DETECTED AN ERROR IN APPLICATION" while using gson 2.5.jar in Android. Can anyone tell me how to solve this? Appreciate it.
I am using a sub-class of Parse Object using Parse SDK.
Here is the stack trace:
The error is occurring at the last line of this code:
I have logged the json string which I am getting. The formatted json string is
The text was updated successfully, but these errors were encountered: