Hi, I'm having trouble using EitherCallAdapterFact...
# arrow
j
Hi, I'm having trouble using EitherCallAdapterFactory when minifying. Do I have to add any extra R8/Proguard rules?
Copy code
@POST("API URL")
    suspend fun signIn(
        @Body request: SignInApiRequest,
    ): Either<CallError, SimpleCallApiResponse<SignInApiResponse>>
s
Doesn't seem like a proguard issue. Looks like the extra generic (SimpleApiResponse) is the issue
AFIK it doesn't need extra rules other than whatever retrofit requires
j
Copy code
@Serializable
data class SimpleCallApiResponse<T>(
    @SerialName("data") val data: T,
)
Copy code
@Serializable
data class SignInApiResponse(
    @SerialName("accessToken") val accessToken: String,
    @SerialName("refreshToken") val refreshToken: String,
)
if I remove Either from response, it's work correctly
s
Could you try the other way, creating a specific type (without generics) for the response
j
I have the same problem with this response
Copy code
@Serializable
data class TestResponse(
    @SerialName("data") val data: SignInApiResponse,
)
it's working if i add this rule
Copy code
-keep class arrow.core.Either** {*;}
s
hm... that's strange.... the adapter doesn't use reflection AFIK