Skip to content
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

Retain generic signature of TypeToken with R8 version 3.0 and higher #1930

Merged
merged 1 commit into from
Aug 5, 2021

Conversation

christofferqa
Copy link
Contributor

R8 version 3.0 started to remove generic signatures from items that are not matched by a -keep rule in full mode (see also https://r8.googlesource.com/r8/+/744d742137a82656b8ee27513f975e0528aecd78). The motivation for this change is to avoid that all generic signatures are retained in programs, when only a few are typically required for reflection.

This change adds a rule that causes the generic signatures of com.google.gson.reflect.TypeToken and its subclasses to be retained. This is needed because com.google.gson.reflect.TypeToken reflectively accesses its own generic signature.

References:

@google-cla google-cla bot added the cla: yes label Aug 5, 2021
@eamonnmcmanus
Copy link
Member

Thanks!

@eamonnmcmanus eamonnmcmanus merged commit 789818d into google:master Aug 5, 2021
@ganadist
Copy link
Contributor

@eamonnmcmanus
Can you look #1929 to apply proguard/r8 rules automatically?

@Marcono1234 Marcono1234 added the proguard-r8 Issues relating to the use of ProGuard and/or R8, such as problems due to obfuscation label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes proguard-r8 Issues relating to the use of ProGuard and/or R8, such as problems due to obfuscation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants