9

Failed to resolve project: Android library and Java library module dependency

 3 years ago
source link: https://stackoverflow.com/questions/49714744/failed-to-resolve-project-android-library-and-java-library-module-dependency/49840285
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Failed to resolve project: Android library and Java library module dependency

I'm trying to create a project which includes an Android library and a Java library in Android Studio (3.1). The Java library depends on the Android library. Both are modules in my project like this:

MyProject    
|-android
|-java

Both appear in settings.gradle:

include ':android', ':java'

And the Java library depends on the Android library like this:

java (build.gradle):

apply plugin: 'java-library'

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation project(':android')
}
...

android (build.gradle):

apply plugin: 'com.android.library'
...

When trying to sync the project I'm getting the following error:

Failed to resolve: project::android

P.S. The other way around (Android depending on Java) works just fine.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK