https://kotlinlang.org logo
#arrow
Title
# arrow
d

dave08

11/13/2023, 4:36 PM
@simon.vergauwen Are there any particular proguard rules I need for Arrow's retrofit adapter? I'm getting
java.lang.IllegalArgumentException: Unable to create call adapter for ta.b<d2.a>
after minifying my code...
d

dave08

11/13/2023, 4:46 PM
I added those rules, and I'm still getting that error...
I'm using the
Either<CallError, T>
form...
s

stojan

11/13/2023, 4:47 PM
In that case there might be some other issue with your proguard config
d

dave08

11/13/2023, 4:48 PM
It does say something about a call adapter and that's the only new call adapter I used in this version.
AND I added Arrow...
s

stojan

11/13/2023, 4:49 PM
Try disabling r8 full mode. That will confirm if it's the issue I linked above or something else
d

dave08

11/13/2023, 4:53 PM
yup, it works w/o full mode @stojan
s

stojan

11/13/2023, 4:58 PM
The arrow adapter used to work without any additional config. With r8 full mode the issue is because of Retrofit. So it's probably something with your code. Maybe check the proguard config for any JSON parsing lib. You could also search this channel, there was a similar discussion some time ago, it might have some additional information
d

dave08

11/13/2023, 5:00 PM
Ok, thanks! At least I know it works for others... I'll try to see what's causing this on my side.
It seems that to get the retrofit arrow adapter to work with r8 full mode, I needed to add
-keep,allowobfuscation,allowshrinking class arrow.core.Either
...
✔️ 2
s

simon.vergauwen

11/14/2023, 2:36 PM
Didn't we put this in the documentation? 🤔
d

dave08

11/14/2023, 2:37 PM
Where? I don't really see a section on Android?
s

simon.vergauwen

11/14/2023, 2:38 PM
I thought it was added somewhere in the documentation of the retrofit adapter, but I might be mistaken. It would be welcomed though! And/or is there a way to bundle this with the library?
s

stojan

11/14/2023, 2:39 PM
Yes, there is a way to bundle it
d

dave08

11/14/2023, 2:39 PM
There isn't any documentation in the github repo... and in the Arrow docs there's just a link to it with no comment.