-
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
Proguard rules for 2.8.8? #1946
Comments
That looks rather weird. Was the exception maybe cut off when you pasted it here, or is ProGuard modifying the Gson JAR? At line 7 there is no Java code.
And #1495 only changed the way enum constant fields are detected, using Java's / Android's So the only reasons for this I can think of are:
Maybe the maintainers have more ideas what could have went wrong. Though could you please provide a more complete stack trace (containing at least all of the lines belonging to Gson)? Note that I am not maintainer of this project. |
Sorry for the delay, i was away on holiday. Here is a complete stacktrace: The file in question (from Microsoft MSAL library) is quite simple:
|
Thanks! Would it be possible to disable ProGuard processing for the Gson library classes? Maybe ProGuard somehow changed Gson's implementation by accident. Additionally these obfuscated stack traces make it difficult to tell where exactly the exception occurred in Gson. Using ProGuard for user classes is something which this library apparently wants to support (at least to some extend), but I am not sure if the maintainers want to support using ProGuard on the Gson classes itself, because it makes debugging like in this case harder. |
closing this issue, as it seems to be related to mobile iron wrapping, and us discontinueing using this wrapper |
Hi,
i have an issue with our app, and it looks like the update of the gson library from 2.8.7 to 2.8.8 is the culprit.
I suspected proguard and updated the rules from https://github.com/google/gson/blob/master/examples/android-proguard-example/proguard.cfg which did not resolve the issues. However, the rules are older than the 2.8.8 release, so maybe the have to be updated?
Looking at the stacktraces it seems to be related to enum:
Caused by: java.lang.ClassCastException: com.microsoft.identity.client.configuration.AccountMode[] cannot be cast to java.lang.Enum
at com.google.gson.internal.bind.TypeAdapters$EnumTypeAdapter.(SourceFile:7)
Checking the release notes i see that 2.8.8 changed this class:
https://github.com/google/gson/releases/tag/gson-parent-2.8.8
EnumTypeAdapter now works better when ProGuard has obfuscated enum fields (#1495).
Now i am unsure what exactly causes the issue, as it only occurs when the apk is wrapped with mobile iron. but as downgrading to json 2.8.7 fixed the issue i decided to write this post anyway.
The text was updated successfully, but these errors were encountered: