android - 我可以使用 Gradle 缩小 dex 中的 65k 方法限制吗?

标签 android gradle proguard

我正在开发一个包含许多库的大型应用程序,我达到了 65k 方法的限制,我想清理一些库以缩小方法的大小。现在我正在使用混淆器,但这需要 5 分钟来编译!所以,我需要一种在混淆器之前清理的方法(比如用 build.gradle 排除或类似的东西) 我正在尝试使用这样的东西:

compile ('com.google.android.gms:play-services:4.3.+'){
    exclude group: 'com.google.android.gms.drive'
    exclude group: 'com.google.android.gms.games'

}

但它不起作用,知道吗?

最佳答案

如果禁用 ProGuard 的优化步骤 (-dontoptimize) 和混淆步骤 (-dontobfuscate),ProGuard 可能足够快以进行调试构建。缩小步骤可以大大减少方法的数量。

关于android - 我可以使用 Gradle 缩小 dex 中的 65k 方法限制吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22948208/

相关文章:

java - Gradle 3.5.1错误错误:找不到符号someclass.java

android - proguard 导致 google play 服务的 ActivityRecognitionResult getMostProbableActivity 崩溃

android - 仅在运行测试时出现 DexIndexOverflowException

android-manifest - 仅适用于平板电脑的应用程序

flutter - 无法打开设置文件的设置通用类缓存 '

android - Android Studio 2 中的 Gradle 缓存目录位置

android - 如何在 ProGuard 中使用绝对文件名?

android - 警报管理器无法通知

android - 底部导航图标在 Android 和 iOS 中显示为正方形

android - "Execution failed for task ' :app:packageDebug ' > Failed to generate v1 signature" exception while compiling Flutter