0

这就是我的 gradle 的样子,我已经注释掉了问题行(更新了完整的 gradle 代码)

数据层

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"
}

领域层

apply plugin: 'java'

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

表示层

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'
}

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'
}

我正在使用 MVP 并将每一层分成不同的模块。在我的数据层中,当我尝试导入房间库时出现错误

“错误:模块 'Umbrella:data-layer:unspecified' 依赖于一个或多个 Android 库,但它是一个 jar”

我不完全理解这意味着什么,我可以采取哪些步骤来调查和解决这个问题?

4

0 回答 0