0

This is what my gradle looks like, I have commented out the problem line (Updated with full gradle code)

data-layer

apply plugin: 'java'

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':models')
    testCompile 'junit:junit:4.12'
    compile "com.squareup.retrofit2:converter-gson:$rootProject.retrofitVersion"
    compile "com.squareup.retrofit2:retrofit:$rootProject.retrofitVersion"
    compile "io.reactivex.rxjava2:rxjava:$rootProject.rxjavaVersion"
    compile "com.squareup.retrofit2:adapter-rxjava2:$rootProject.retrofitRxjava2Version"
    compile "com.google.dagger:dagger:$rootProject.daggerVersion"
    //compile "android.arch.persistence.room:runtime:$rootProject.roomVersion"
}

domain-layer

apply plugin: 'java'

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':data-layer')
    testCompile 'junit:junit:4.12'
}

presentation-layer

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.example.admin.umbrella"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile project(':domain-layer')
    compile 'com.android.support:appcompat-v7:26.+'
    compile "com.android.support.constraint:constraint-layout:$rootProject.constraintLayoutVersion"
    compile "com.android.support:cardview-v7:$rootProject.cardViewVersion"
    compile "com.android.support:recyclerview-v7:$rootProject.recyclerviewVersion"
    compile "com.jakewharton:butterknife:$rootProject.butterknifeVersion"
    compile "com.android.support:design:$rootProject.designVersion"
    compile "com.google.dagger:dagger:$rootProject.daggerVersion"
    annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.daggerVersion"
    testCompile 'junit:junit:4.12'
}

root

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://maven.google.com" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

ext {
    constraintLayoutVersion = '1.0.2'
    cardViewVersion = '26.1.0'
    recyclerviewVersion = '26.1.0'
    butterknifeVersion = '8.8.1'
    designVersion = '26.1.0'
    daggerVersion = '2.11'
    roomVersion = '1.0.0-beta1'
    retrofitRxjava2Version = '2.3.0'
    retrofitVersion = '2.3.0'
    rxjavaVersion = '2.0.1'
}

I am working with MVP and have each layer split into different modules. In my data-layer when I try to import room library I get the error

"Error:Module 'Umbrella:data-layer:unspecified' depends on one or more Android Libraries but is a jar"

I don't fully understand what that means, What steps can i take to investigate and solve this problem?

Olay
  • 43
  • 3
  • 7
  • Seems missing maven repo. Please post entire gradle – VVB Oct 02 '17 at 05:22
  • updated with entire gradle – Olay Oct 02 '17 at 05:35
  • Try adding these lines compile 'android.arch.persistence.room:runtime:' + rootProject.archRoomVersion; annotationProcessor 'android.arch.persistence.room:compiler:' + rootProject.archRoomVersion; – VVB Oct 02 '17 at 05:38
  • Also, one more thing noticed is studio causes warning when you move from java lib to android libs. Ideally, it should be in reverse order. – VVB Oct 02 '17 at 05:50

0 Answers0