1

在 Android Studio 中使用 DexGuard 时,调试构建非常缓慢。

4

2 回答 2

4

使 DexGuard 仅在“发布”构建期间工作,更改“build.gradle”文件:

  1. 将“应用插件:'dexguard'”从全局范围移动到“发布”构建类型范围
  2. 从“Debug”构建中删除“getDefaultDexGuardFile”调用

例如:

android {
    ...
    ...
    buildTypes {
        debug {
            minifyEnabled false
            ...
        }
        release {
            apply plugin: 'dexguard'
            minifyEnabled true
            proguardFile getDefaultDexGuardFile('dexguard-release.pro')
            proguardFiles 'proguard-project.txt'
            ...
            ...
        }
    }
}
于 2015-11-10T06:59:41.170 回答
0
**#Retrofit**
-keep class retrofit.** { ; }

-keepattributes Signature

-keepattributes Exceptions

-keepclasseswithmembers class * {
@retrofit2.http. ;
}

-keepclasseswithmembers interface * {
@retrofit2.http.* ;
}

-dontwarn javax.annotation.Nullable

-dontwarn javax.annotation.ParametersAreNonnullByDefault

-dontobfuscate - only in debug mode production mode dont use this

-dontoptimize

-dontshrink

Please use in this lines Dexguard-project.txt file. that's all. Enjoy your coding...
于 2021-01-13T13:26:45.397 回答