在成绩构建中有不同的依赖关系吗?

Apq*_*pqu 6 android gradle android-studio android-gradle-plugin

我有一个调试版本和一个Android应用程序的发布版本但是我需要每个不同的依赖项,这可能在Android Studio中吗?

我有一节:

buildTypes {
        debug {
            minifyEnabled false
        }
        release {
            minifyEnabled true
        }
}
Run Code Online (Sandbox Code Playgroud)

和依赖项的一节:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'joda-time:joda-time:2.7'
    compile 'org.joda:joda-convert:1.4'
}
Run Code Online (Sandbox Code Playgroud)

我想删除joda-convert依赖,如果我使用调试版本,因为它导致"包装APK中的重复文件"错误.

任何帮助非常感谢?

lig*_*igi 7

您可以使用

releaseCompile 'org.joda:joda-convert:1.4'
Run Code Online (Sandbox Code Playgroud)

然后joda-convert仅用于发布