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

Consider adding a README section about using the retrofit adapter when using R8 in full mode. #121

Open
StylianosGakis opened this issue Apr 25, 2023 · 0 comments

Comments

@StylianosGakis
Copy link

StylianosGakis commented Apr 25, 2023

Is your feature request related to a problem? Please describe.
When bumping to AGP 8.x + Gradle 8.x R8 is in full mode by default. This strips the Either signature completely and makes Retrofit crash at runtime since it doesn't know how to turn the response into an Either.

Describe the solution you'd like
Provide a section in the README which explains which proguard rules to add so that R8 doesn't strip the classes necessary for it to work.

Additional context
Original discussion here https://kotlinlang.slack.com/archives/C5UPMM0A0/p1682434620473839 (publicly available at https://slack-chats.kotlinlang.org/t/10500890/anyone-here-using-https-github-com-arrow-kt-arrow-integratio#17ca4ffe-2c9b-488d-ab40-68da2b17b67b)

My solution has been to add
-keep,allowobfuscation,allowshrinking class arrow.core.Either in my proguard file, but I am not sure if this is the optimal way to solve it. Only took inspiration from this discussion here square/retrofit#3751 (comment)

If someone could chip in to give a better idea or more confidently suggest this as the right solution that would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant