当我试图在互联网上找到解决方案时,但与我的情况没有太多相关
接下来的问题是,构建失败并出现错误:
错误:未捕获的翻译错误:com.android.dx.cf.code.SimException:局部变量类型不匹配:尝试使用 int 类型的局部变量设置或访问 java.lang.Object 类型的值。这是忽略局部变量信息的 .class 转换工具的症状。
我有2个配置
buildTypes {
debug {
debuggable true
minifyEnabled true
signingConfig signingConfigs.defaultKey
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
debuggable false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
问题是,如果我关闭调试混淆器(minifyEnabled false),我会遇到构建问题
Error:Uncaught translation error: com.android.dx.cf.code.SimException: local variable type mismatch: attempt to set or access a value of type java.lang.Object using a local variable of type int. This is symptomatic of .class transformation tools that ignore local variable information.
Error:Uncaught translation error: com.android.dx.cf.code.SimException: local variable type mismatch: attempt to set or access a value of type int using a local variable of type android.util.SparseIntArray. This is symptomatic of .class transformation tools that ignore local variable information.
由于启用了 proguard,Inta-Run 被禁用
所以无论我做什么我都无法超越这一点,即使我创建单独的 proguard 文件(调试一个)
并放置下一个:
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
-dontobfuscate
-dontoptimize
-dontpreverify
-ignorewarnings
变得相同,尝试使用:multiDexEnabled true
但仍然没有成功
在这种情况下,启用混淆器后,我可以构建,正常进行调试/发布,并且除调试之外的所有工作(我非常需要)
这是我连续第二天遇到问题并且无法解决它
有人有类似的问题吗?我怎样才能解决它?
附:
带有堆栈跟踪和调试标志的 gradle 没有给我任何有用的东西,所以没有帮助