arrow-kt / arrow-integrations

Λrrow Integrations is part of Λrrow, a functional companion to Kotlin's Standard Library
http://arrow-kt.io
Other
27 stars 6 forks source link

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

Open StylianosGakis opened 1 year ago

StylianosGakis commented 1 year ago

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 https://github.com/square/retrofit/issues/3751#issuecomment-1192043644

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