【问题标题】:DexGuard error while trying to enable minifying in ProGuard尝试在 ProGuard 中启用缩小时出现 DexGuard 错误
【发布时间】:2021-04-12 08:32:25
【问题描述】:

我正在尝试使用 ProGuard 在 Android 应用中启用缩小功能。

当我将minifyEnabled 设置为false 时,它会构建,但一旦我将其设置为true

buildTypes {

    debug {
        minifyEnabled false
        jniDebuggable true
        versionNameSuffix '_DEBUG'
        zipAlignEnabled true
    }
    release {
        minifyEnabled true
        proguardFile getDefaultDexGuardFile('dexguard-release.pro')
        proguardFile 'dexguard-project.txt'
        jniDebuggable false
        signingConfig signingConfigs.release
    }

我收到一个 gradle 同步错误:

ERROR: minifyEnabled is set to 'true' for variant <name of the variant>.

堆栈跟踪状态:

org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':MainApp'
Caused by: org.gradle.api.GradleException: Errors occurred during DexGuard plugin configuration.

DexGuard 在这里必须做什么?

【问题讨论】:

  • 在发布模式下,您在某些属性中设置了dexguard
  • 我的错,我在开发团队使用的插件方面混淆了 DexGuard 和 ProGuard。

标签: android proguard minify dexguard


【解决方案1】:

Dexguard 的文档说:

DexGuard 期望其输入不会被混淆,因此请确保您在此处指定的所有变体都没有将 minifyEnabled 选项设置为 true。

你不能在同一个库中同时使用 Dexugard 和 Proguard。您必须禁用 Dexguard 或 Proguard。

Dexguard 是 Progurad 的改进(和付费)版本。当你有 Dexguard 时,我看不出有任何使用 Proguard 的理由。

【讨论】:

    猜你喜欢
    • 2019-11-09
    • 2018-12-17
    • 2021-04-14
    • 2012-02-05
    • 2018-04-12
    • 2023-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多