我有一个这样的项目布局:
MyProject/
Project/
build.gradle
build.gradle
settings.gradle
thirdparty/
ActionBarSherlock/
actionbarsherlock/
build.gradle
build.gradle
settings.gradle
该ActionBarSherlock
目录是一个 git 子模块,指向dev
ActionBarSherlock 的分支,其中包含 gradle 构建文件。
在MyProject/settings.gradle
我补充说:
include '..:thirdparty:ActionBarSherlock:actionbar'
并MyProject/build.gradle
补充说:
compile '..:thirdparty:ActionBarSherlock:actionbar'
到该dependencies
部分。当我构建MyProject/Project
时,gradle assemble
出现以下错误:
> Project with path '..:thirdparty:ActionBarSherlock:actionbar' could not be found in project ':MyProject'
我可以ActionBarSherlock
单独构建,使用:
cd thirdparty/ActionBarSherlock/actionbarsherlock
gradle assemble
cp build/libs/actionbarsherlock-4.3.2-SNAPSHOT.aar ../../../MyProject/Project/libs
然后在asdependencies
部分使用它MyProject/build.gradle
:
compile files('libs/actionbarsherlock-4.3.2-SNAPSHOT.aar')
现在,当我构建时,出现MyProject/Project
以下错误:
> Duplicate files at the same path inside the APK: AndroidManifest.xml