Skip to content

Proguard rules for 2.8.8? #1946

@slowcar

Description

@slowcar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions