我的项目使用调试构建变体构建得很好,但使用发布变体 Android Studio 会抛出:
引起原因:java.lang.ArrayIndexOutOfBoundsException:213
可能是什么问题?
如果我设置minifyEnabled false
在构建 gradle 中发布构建变体,然后它构建正常,但它不好
Update
我尝试添加到proguard-rules.pro
-keepnames class com.google.android.gms.** {*;}
它构建了,但我不喜欢这个解决方案,我不想保留所有内容com.google.android.gms
...
有什么好的解决办法吗?
附注我用classpath 'com.google.gms:google-services:4.2.0'
它根 build.gradle 作为依赖项
Update 2
现在它开始抛出Execution failed for task ':app:transformClassesWithDexBuilderForRelease'.
当然使用了 Multi Dex 库(我的目标是 Android API 14+)
我通过更新到 Android Studio 3.4 RC 2 解决了这个问题,它使用R8默认情况下而不是Proguard
现在构建变体minifyEnabled true
工作正常
Seems R8也可以与 Stable AS 3.3 一起使用,但需要一些配置:https://android-developers.googleblog.com/2018/11/r8-new-code-shrinker-from-google-is.html https://android-developers.googleblog.com/2018/11/r8-new-code-shrinker-from-google-is.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)