0

I followed all the tutorials in stackoverflow about this.

I have an android app in project/android, and a second project in project/api. What can I do in project/android to add project/api as a dependency?

I followed Android studio add external project to build.gradle by doing

include ':VenkoAPI'
project(':VenkoAPI').projectDir = new File(settingsDir, '../../api')

in settings.gradle

and then

dependencies {
    compile project(':VenkoAPI')

in build.gradle. I'm getting

ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :VenkoAPI.
ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve project :VenkoAPI.
ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve project :VenkoAPI.

What do these errors mean?

Guerlando OCs
  • 1,886
  • 9
  • 61
  • 150

1 Answers1

1

Change your settings.gradle as

include ':Project', ':API_PROJECT_NAME'

And in your build.gradle:

implementation project(path: ':API_PROJECT_NAME')

This works for me.

Vishal
  • 391
  • 5
  • 20