【问题标题】:Proguard behavior differs based on build type though setup is relatively identicalProguard 行为因构建类型而异,尽管设置相对相同
【发布时间】:2018-03-15 16:33:34
【问题描述】:
release {
    minifyEnabled true
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}

debug {
    //region Temp
    minifyEnabled true
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    //endregion

    applicationIdSuffix ".debug"
}

所以,我有 2 种构建类型具有相同的 proguard 设置。即使debug 构建缩小了代码,我在release 中遇到运行时错误,因为在我看来,一些额外的代码缩小。因此,我不能依赖在debug 构建下测试我的应用程序和proguard。

是否有任何其他标志可以指定重现release' debug 构建类型中的 proguard 收缩设置? 另外,有没有办法检查完整的构建类型规范(包括继承的规范)?项目结构提供了一些信息,但是,我相信还有更多信息,我还想检查构建类型继承。

谢谢。

附言compile 'com.github.hosopy:actioncable-client-java:0.1.2' 这个依赖不会在debug 中收缩

【问题讨论】:

    标签: android gradle proguard


    【解决方案1】:

    看看你的dependencies 部分。您可能有一些发布版本类型中未提供的依赖项。像 debugCompiledebugImplementation 仅适用于调试构建类型的依赖项。

    【讨论】:

    • 谢谢,但这只是一个implementation 依赖
    猜你喜欢
    • 1970-01-01
    • 2011-03-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多