-
Notifications
You must be signed in to change notification settings - Fork 761
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
Do not reference kotlin.Metadata #1115
Comments
Hmm, the only keep rule for |
Yes I am not using the reflect artifact. The line of code I highlighted in the issue is not present in the 1.8.0 release, so my guess is that r8 is smart enough to realize that the kotlin.Metadata class is used via r reflection and keeps it because of that. |
Ask it? |
Seems like my guess was correct: moshi 1.9.2
moshi 1.8.0
|
Faced the same after finding a workaround for my generics issue.
To R8 config does workaround this. |
FYI: Asked R8 team https://issuetracker.google.com/issues/152811099 Seems only a workaround is available for now. |
…ep rules. This makes application build with Moshi to keep unwanted Kotlin Metadata that have a huge impact on APK size. After discussion with R8 team, there's currently no solution to avoid this other than using the trick in this PR. Fixes square#1115
…ep rules. This makes application build with Moshi to keep unwanted Kotlin Metadata that have a huge impact on APK size. After discussion with R8 team, there's currently no solution to avoid this other than using the trick in this PR. Fixes square#1115
…ep rules. This makes application build with Moshi to keep unwanted Kotlin Metadata that have a huge impact on APK size. After discussion with R8 team, there's currently no solution to avoid this other than using the trick in this PR. Fixes square#1115
…ep rules. This makes application build with Moshi to keep unwanted Kotlin Metadata that have a huge impact on APK size. After discussion with R8 team, there's currently no solution to avoid this other than using the trick in this PR. Fixes square#1115
Hello @Tolriq, I tried your workaround by adding assumevalues but it does not work for me with Moshi 1.9.2/1.9.3. Do you have any suggestions?
|
There is a pull request with the workaround to not reference it still open. |
Assume value no more works with last R8. The proper fix is yet to be merged :( I hope my 2 PR are one day merged and a new release is made. |
…ep rules. This makes application build with Moshi to keep unwanted Kotlin Metadata that have a huge impact on APK size. After discussion with R8 team, there's currently no solution to avoid this other than using the trick in this PR. Fixes square/moshi#1115
After updating from moshi 1.8.0 to 1.9.2
kotlin.Metadata
annotations are suddenly kept by r8, which increases apk size on android unnecessarily. My guess is the class lookup in https://github.com/square/moshi/blob/master/moshi/src/main/java/com/squareup/moshi/internal/Util.java#L57This is really not required if you are only using generated adapters for kotlin classes and don't want to use the
ClassJsonAdapter
at all.The text was updated successfully, but these errors were encountered: