-
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
NoSuchFieldException when serializing objects with an enumeration field on Samsung devices running Android 5.0.x #924
Comments
This is a bug in Samsung's version of Android. I don't think there's anything you can do and there's certainly nothing we can do. |
Thanks for your support @JakeWharton. That is exactly what I suspected. |
this is not a bug in samsungs version of android. i get the same thing on a nexus5x running android 8.1.0. its more lily a pro guard issue. See: https://stackoverflow.com/questions/15543607/assertionerror-in-gson-enumtypeadapter-when-using-proguard-obfuscation |
@bpappin as described in the issue pro guard was not used |
I also got same exception but problem was i extending model with facebook native ad i just make that field transient and it worked fine. |
Anyone resolved this ? I am getting this issue on all my devices |
Try method from this article: |
Stack trace
Crash Descriprion
I can see this crash on Samsung devices running Android 5.0.x only.
I'm using gson-2.7 and I'm not usin ProGurad.
The crash occurs when I try to serialize an object of a specific type that contains a field of type enumeration.
However, it does not occur sistematically but rather randomly.
As fas as I understand, such an exception cannot be caused by my app's code.
Moreover, by inspecting gson code, I cannot understand why this exception is generated. It seems to me that this should never happen:
The NoSuchFieldException exception is thrown when the
Class.getField(String name)
method is called (line 797)Any idea on why this exception is thrown?
What could be the reason that causes a similar crash?
The text was updated successfully, but these errors were encountered: