Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minified build crashes with java.lang.ClassCastException java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType #125

Open
mateot1 opened this issue Feb 6, 2024 · 1 comment

Comments

@mateot1
Copy link

mateot1 commented Feb 6, 2024

Fatal Exception: java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
       at com.affirm.android.AffirmClient$1.onResponse(AffirmClient.java:86)
       at com.google.firebase.perf.network.InstrumentOkHttpEnqueueCallback.onResponse(InstrumentOkHttpEnqueueCallback.java:71)
       at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
       at java.lang.Thread.run(Thread.java:1012)

This seems similar to: square/retrofit#3751
I can't tell if you're using Retrofit, but considering your last release was in early 2022 I would guess you also need to make changes to support R8

@mateot1
Copy link
Author

mateot1 commented Feb 6, 2024

After looking more closely at AffirmClient I see you are not using Retrofit, but Okhttp directly.
For now, keeping everything via -keep class com.affirm.android.** { *; } , seems to fix the crash. not sure if there are more precise rules you'd suggest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant