假设我的Android Studio项目中有2个模块:
---- :A
---- :B
其中:A依赖于B:
---- :A ---> + :B
---- :B
A和B都需要库L:使事情复杂化
---- :A ---> + :B
+ :L
---- :B ---> + :L
最初包含的模块的gradle文件:
模块A:
dependencies {
compile project(':B')
compile 'com.L:library:1.0.0'
}
模块B:
dependencies {
compile 'com.L:library:1.0.0'
}
但这会给出一个错误,表明在dex文件的inputList.txt中提供了多个库:
Execution failed for task ':funtainment:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Development\Android\AndroidStudio\Sdk\build-tools\21.1.2\dx.bat --dex --no-optimize --output C:\Development\Workspace\Android\AndroidStudio\Funtainment\funtainment\