As per this question I'm trying to setup the following project structure
project/
settings.gradle
projectB/ # some common code (using spring-boot)
build.gradle
com/
foo/
bar/...
projectA/ # an android app
build.gradle
com/
foo/
baz/...
settings.gradle
looks like
rootProject.name = "project"
include ":projectB"
project(":projectB").projectDir = new File(rootDir, './projectB')
include ":projectA"
project(":projectA").projectDir = new File(rootDir, './projectA')
and in projectA/build.gradle
I have
dependencies {
implementation project(":projectB")
}
Android Stuido seems happy and will provide code completion and searching for code in projectB
within projectA
. However compilation fails with an error
Unsresolved reference: bar
on the line where I try to import com.foo.bar.whatever
.
I have tried a number of different changes to the various gradle files but nothing has fixed this error.
What is the problem with this setup and how can it be resolved?
Thanks