Android 在Gradle中,对一种口味应用不同的依赖版本

Android 在Gradle中,对一种口味应用不同的依赖版本,android,gradle,android-gradle-plugin,build.gradle,android-build,Android,Gradle,Android Gradle Plugin,Build.gradle,Android Build,我知道如何为一种特定的口味添加依赖项,如图和所示 但在我当前的设置中,我需要1种口味来使用1个版本的库,而所有其他口味都需要使用不同的版本。比如: // this gets applied to all flavors expect "otherFlavor" compile 'com.awesome.library:lib:1.0' // this gets applied only to "otherFlavor otherFlavorCompile 'com

我知道如何为一种特定的口味添加依赖项,如图和所示

但在我当前的设置中,我需要1种口味来使用1个版本的库,而所有其他口味都需要使用不同的版本。比如:

// this gets applied to all flavors expect "otherFlavor"
compile 'com.awesome.library:lib:1.0'

// this gets applied only to "otherFlavor
otherFlavorCompile 'com.awesome.library:lib:1.1'
如果我按此代码所示进行尝试,我会不断得到:

错误:任务“:app:ProcessOtherValveDebugResources”的执行失败。 错误:包名为“com.awesome.library”的多个库

不必列出每个.single.flavor就可以了吗

谢谢