我正在尝试使用以下结构构建项目。它是一个使用另一个库(Google Volley)的库项目的应用程序。
- MainProject
|-- ModuleProject
|-- SubmoduleProject
ModuleProject /的build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
apply plugin: 'android-library'
dependencies {
compile project(':SubmoduleProject')
}
ModuleProject / settings.gradle
include ':SubmoduleProject'
Android studio抛出以下错误:
Project with path ':SubmoduleProject' could not be found in project ':ModuleProject'
如何使用嵌套库构建项目?
答案 0 :(得分:0)
您的MainProject/settings.gradle
应该
include 'ModuleProject', 'ModuleProject:SubmoduleProject'
,依赖关系将为compile project(':ModuleProject:SubmoduleProject')