I am new to Gradle. I have a simple project structure (see below) with the main Android application module, one Android module (myandroidlibrary) and one pure java module (myjavalibrary). They have simple dependencies, app โ myjavalibary, myjavalibary โ myandroidlibrary (see Figure below). Below are snapshots of Gradle files.
However, when synchronizing Gradle, it throws the following error:
D:\MyTestCodes\MyTestApplication\app\build.gradle Warning:Module version MyTestApplication:myjavalibrary:unspecified depends on libraries but is a jar
Help me! I spent all this day to deal with this to no avail!
MyProject - app - myjavalibrary (pure java library) - myandroidlibrary (android library)
Now the dependency is as follows:
"app" depends on -> "myjavalibrary" "myjavalibrary" depends on -> "myandroidlibrary"
Gradle files for each of the modules:
gradle file for app module: ---------------------------- apply plugin: 'com.android.application' android { // ommitting other detail dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.0.0' compile project(':myjavalibrary') } Gradle file for myjavalibrary module: ------------------------------------- apply plugin: 'java' dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile project(':myandroidlibrary') } gradle file for myandroidlibrary module: ---------------------------- apply plugin: 'com.android.application' android { //ommiting other detail. dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.0.0' } The settings.gradle: --------------------- include ':app', ':myjavalibrary', ':myandroidlibrary'
Now when I sync Gradle files, it shows the following error:
D:\MyTestCodes\MyTestApplication\app\build.gradle Warning:Module version MyTestApplication:myjavalibrary:unspecified depends on libraries but is a jar
source share