-
Notifications
You must be signed in to change notification settings - Fork 213
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
使用AGPv8代码混淆后Gson解析报错:Missing type parameter. #203
Comments
你确定在gradle版本不变的情况下降级到3.5.8就能立刻解决问题吗 |
Duplicate of #201 相同问题, AGPv8.0导致 推测以下代码导致即使AGPv8.0也不会报错
@OptIn(ExperimentalStdlibApi::class)
inline fun <reified T> typeTokenOf() = typeOf<T>().javaType
之所以这么改当初应该是为了支持基础类型(例如 |
确定,我昨天晚上从3.6.1一个版本一个版本往下降进行尝试了,到3.5.8就没问题了。然后有两点需要注意的:
Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken |
@op123355569 看到你提供的信息, 的确需要给Net也单独添加混淆规则 Duplicate of google/gson#2069 |
你试下以下版本 implementation 'com.github.liangjingkanji:Net:8dba7488fc' |
可以了,用这个库就正常了 |
已发布新的正式版本 |
牛,我上周打包发现这个问题,然后在gradle.properties里设置 # 兼容自定义的Proguard混淆规则
android.enableR8.fullMode=false 就好了,虽然打的包会大一点,但是r8的fullMode模式,混淆会更加激进,优点是体积更小,混淆程度更高,但是要额外配置混淆规则 |
问题描述
从3.5.9开始,代码混淆之后Gson解析报错,报Caused by: java.lang.RuntimeException: Missing type parameter.
应该是3.5.9的升级内容导致的,我退回到3.5.8就没问题了,3.6.0和3.6.1都试过,都不行
Gradle:gradle-8.0-bin
Gradle tool:8.1.1
期望行为
希望在下个版本修复,谢谢大佬。
如何复现
截图
异常堆栈信息或者手机截图/视频(拖拽到输入框即可上传)
版本
The text was updated successfully, but these errors were encountered: