Stylianos Gakis
04/25/2023, 2:57 PMjava.lang.IllegalArgumentException: Unable to create call adapter for retrofit2.Call<arrow.core.Either>
for function of mine which is of the signature
@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.simon.vergauwen
04/25/2023, 3:01 PM# 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.
Stylianos Gakis
04/25/2023, 3:11 PM-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