Anyone here using <arrow-integrations-retrofit-ada...
# arrow
s
Anyone here using arrow-integrations-retrofit-adapter along with the latest gradle 8.x + Agp 8.x where R8 is by default in full mode? Basically after doing this bump, and after following this thread https://github.com/square/retrofit/issues/3751#issuecomment-1192043644 and adding the rules as expected here, I’m still getting the issue
java.lang.IllegalArgumentException: Unable to create call adapter for retrofit2.Call<arrow.core.Either>
for function of mine which is of the signature
Copy code
@Multipart
@POST("{id}/foo")
suspend fun uploadAudioRecordingFile(
  @Path("id") id: String,
  @Part file: MultipartBody.Part,
): Either<CallError, UploadAudioRecordingResult>

@Serializable
data class UploadAudioRecordingResult(val audioUrl: String)
I wonder due to our use of
Either
there we need to add some rule to also keep Either so that R8 does not remove it or something like that? Really not that comfortable working with R8 related problems, so I was hoping someone else has encountered this before. Just so I understand if it’s something that this library can help us with by including the rules in the readme, so that I’ll open an issue there or if it may be something on my end and completely unrelated to it.
s
Reading this:
# With R8 full mode generic signatures are stripped for classes that are not
# kept. Suspend functions are wrapped in continuations where the type argument
# is used.
I would say yes, because the generic signature is probably getting erased.
s
Yup, added this line
Copy code
-keep,allowobfuscation,allowshrinking class arrow.core.Either
And it now works. But I really am not sure if this is the right thing to add, or if this has any other implications that we don’t want to happen as a side effect of this. Regardless, I will open an issue on that repo and see if someone can more confidently suggest this or a better solution so that it can be added in the readme of that library as a warning if using R8 + it’s in full mode