相关疑难解决方法(0)

Proguard (R8) 否定操作员不保留某些包以外的任何东西

proguard 中的否定符(感叹号)应该允许我保留 apache 库之外的其他内容:

-keep class !org.apache.**
Run Code Online (Sandbox Code Playgroud)

根据这些答案。这就是要走的路:

但是,它混淆了我的 APK 中的所有类。

这是我的 build.gradle 的一部分(我有 Android Studio 3.5.3)

compileSdkVersion 29
buildToolsVersion "29.0.2"
//...
buildTypes {

    release {

        minifyEnabled true
        proguardFiles /*getDefaultProguardFile('proguard-android.txt'),*/  'proguard-rules.pro'

        // Enables resource shrinking, which is performed by the
        // Android Gradle plugin.
        shrinkResources false
    }
}

dependencies {
    //Utility libs
    implementation 'org.apache.commons:commons-collections4:4.1'
    implementation 'org.apache.commons:commons-lang3:3.4'
    implementation group: 'commons-io', name: 'commons-io', version: '2.5'
}
Run Code Online (Sandbox Code Playgroud)

添加 …

android proguard apk android-r8

5
推荐指数
2
解决办法
1556
查看次数

标签 统计

android ×1

android-r8 ×1

apk ×1

proguard ×1