Describe the bug
if enable R8,
debug {
minifyEnabled true // 启用混淆
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
sdk will report exception: java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType when create Risk instance.
To Reproduce
Steps to reproduce the behavior:
- enable R8
- create Risk Instance
val riskInstance = Risk.getInstance(
context,
RiskConfig(
getPublicKey(),
getRiskEnvironment()
)
)
deviceDataService.getConfiguration() is a retrofit request, it will throw java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType when create Risk instance.
3. See error

Smartphone (please complete the following information):
- Device: [SM-S911U1]
- OS: [Android 16]
- Version [com.github.checkout:checkout-risk-sdk-android:2.1.0, com.squareup.retrofit2:retrofit:2.9.0, com.squareup.okhttp3:okhttp:4.12.0]