I am trying to configure gradle for a multiproject environment.

My project structure is as follows:

MainProject
--external
  --A
  --B
  --C

I have been able to configure the build.gradle and the settings.gradle file for the MainProject.

The problem that I have is that both subprojects A & B depend on C

In project A 's build.gradle

apply plugin: 'android-library'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile project('../C')
}

Gradle says unable to find project with path ../C. What path should I put in there?

有帮助吗?

解决方案

Try with:

compile project(':external:C')

For more details about project paths see section 56.5 in the Gradle user guide.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top