3

将 Android Studio 更新到 3.3 Canary 10(来自以前的 Canary)后,我开始遇到 Gradle 同步问题:

ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.annotation:annotation:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.legacy:legacy-support-core-utils:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.core:core:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.collection:collection:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.versionedparcelable:versionedparcelable:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.documentfile:documentfile:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.loader:loader:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.localbroadcastmanager:localbroadcastmanager:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.print:print:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve io.reactivex.rxjava2:rxjava:2.0.6.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve org.reactivestreams:reactive-streams:1.0.0.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve io.reactivex.rxjava2:rxjava:2.2.0.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.legacy:legacy-support-core-utils:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve io.reactivex.rxjava2:rxjava:2.0.6.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.annotation:annotation:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.core:core:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.collection:collection:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.legacy:legacy-support-core-utils:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve org.reactivestreams:reactive-streams:1.0.2.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.annotation:annotation:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.documentfile:documentfile:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.loader:loader:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.localbroadcastmanager:localbroadcastmanager:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.print:print:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.versionedparcelable:versionedparcelable:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@debugFeature/compileClasspath': Could not resolve androidx.core:core:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.annotation:annotation:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.legacy:legacy-support-core-utils:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.core:core:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.collection:collection:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.versionedparcelable:versionedparcelable:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.documentfile:documentfile:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.loader:loader:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.localbroadcastmanager:localbroadcastmanager:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.print:print:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve io.reactivex.rxjava2:rxjava:2.0.6.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve org.reactivestreams:reactive-streams:1.0.0.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve io.reactivex.rxjava2:rxjava:2.2.0.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.legacy:legacy-support-core-utils:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve io.reactivex.rxjava2:rxjava:2.0.6.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.annotation:annotation:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.core:core:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.collection:collection:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.legacy:legacy-support-core-utils:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve org.reactivestreams:reactive-streams:1.0.2.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.annotation:annotation:1.0.0-rc01.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.documentfile:documentfile:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.loader:loader:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.localbroadcastmanager:localbroadcastmanager:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.print:print:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.versionedparcelable:versionedparcelable:1.0.0-rc02.
Show Details
Affected Modules: feature


ERROR: Unable to resolve dependency for ':feature@releaseFeature/compileClasspath': Could not resolve androidx.core:core:1.0.0-rc01.
Show Details
Affected Modules: feature

我的 build.gradle 模块“功能”:

apply plugin: 'com.android.feature'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'kotlin-kapt'

apply plugin: "androidx.navigation.safeargs"

android {
    compileSdkVersion 28
    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        kapt {
            arguments {
                arg("room.schemaLocation", "$projectDir/schemas".toString())
            }
        }
    }

    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
}

repositories {
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

    implementation project(':base')

    // Moxy
    implementation 'com.squareup:javapoet:1.11.1'
    implementation files('libs/moxy.jar')
    implementation files('libs/moxy-androidx.jar')
    implementation files('libs/moxy-android.jar')
    kapt files('libs/moxy-compiler.jar')

    // Wait till moxy will release AndroidX support
    //    implementation 'com.arello-mobile:moxy:1.5.5'
    //    implementation 'com.arello-mobile:moxy-android:1.5.5'
    //    kapt 'com.arello-mobile:moxy-compiler:1.5.5'

    // Room
    implementation "androidx.room:room-runtime:$room_version"

    kapt "androidx.room:room-compiler:$room_version"

    implementation "androidx.room:room-rxjava2:$room_version"

    // Dagger
    implementation "com.google.dagger:dagger:$dagger_version"
    kapt "com.google.dagger:dagger-compiler:$dagger_version"

    testImplementation 'junit:junit:4.12'
    testImplementation "androidx.room:room-testing:$room_version"

    androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'

}

项目的 build.gradle:

buildscript {
    ext {
        kotlin_version = '1.2.70'
        room_version = '2.0.0-rc01'
        dagger_version = '2.17'
        rxjava_version = '2.2.0'
        rxandroid_version = '2.1.0'
        rxkotlin_version = '2.3.0'
    }

    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0-alpha10'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:1.0.0-alpha05"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

依赖项:

+--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.70
|    \--- org.jetbrains.kotlin:kotlin-stdlib:1.2.70
|         +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.2.70
|         \--- org.jetbrains:annotations:13.0
+--- org.jetbrains.kotlin:kotlin-stdlib:1.2.70 (*)
+--- org.jetbrains.kotlin:kotlin-stdlib-common:1.2.70
+--- org.jetbrains:annotations:13.0
+--- androidx.appcompat:appcompat:1.0.0-rc02
|    +--- androidx.annotation:annotation:1.0.0-rc02
|    +--- androidx.core:core:1.0.0-rc02
|    |    +--- androidx.annotation:annotation:1.0.0-rc02
|    |    +--- androidx.collection:collection:1.0.0-rc02
|    |    |    \--- androidx.annotation:annotation:1.0.0-rc02
|    |    +--- androidx.lifecycle:lifecycle-runtime:2.0.0-rc01
|    |    |    +--- androidx.lifecycle:lifecycle-common:2.0.0-rc01
|    |    |    \--- androidx.arch.core:core-common:2.0.0-rc01
|    |    |         \--- androidx.annotation:annotation:1.0.0-rc01 -> 1.0.0-rc02
|    |    \--- androidx.versionedparcelable:versionedparcelable:1.0.0-rc02
|    |         +--- androidx.annotation:annotation:1.0.0-rc02
|    |         \--- androidx.collection:collection:1.0.0-rc02 (*)
|    +--- androidx.collection:collection:1.0.0-rc02 (*)
|    +--- androidx.cursoradapter:cursoradapter:1.0.0-rc02
|    |    \--- androidx.annotation:annotation:1.0.0-rc02
|    +--- androidx.legacy:legacy-support-core-utils:1.0.0-rc02
|    |    +--- androidx.annotation:annotation:1.0.0-rc02
|    |    +--- androidx.core:core:1.0.0-rc02 (*)
|    |    +--- androidx.documentfile:documentfile:1.0.0-rc02
|    |    |    \--- androidx.annotation:annotation:1.0.0-rc02
|    |    +--- androidx.loader:loader:1.0.0-rc02
|    |    |    +--- androidx.annotation:annotation:1.0.0-rc02
|    |    |    +--- androidx.core:core:1.0.0-rc02 (*)
|    |    |    +--- androidx.lifecycle:lifecycle-livedata-core:2.0.0-rc01
|    |    |    |    +--- androidx.lifecycle:lifecycle-common:2.0.0-rc01
|    |    |    |    +--- androidx.arch.core:core-common:2.0.0-rc01 (*)
|    |    |    |    \--- androidx.arch.core:core-runtime:2.0.0-rc01
|    |    |    |         +--- androidx.annotation:annotation:1.0.0-rc01 -> 1.0.0-rc02
|    |    |    |         \--- androidx.arch.core:core-common:2.0.0-rc01 (*)
|    |    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0-rc01
|    |    +--- androidx.localbroadcastmanager:localbroadcastmanager:1.0.0-rc02
|    |    |    \--- androidx.annotation:annotation:1.0.0-rc02
|    |    \--- androidx.print:print:1.0.0-rc02
|    |         \--- androidx.annotation:annotation:1.0.0-rc02
|    +--- androidx.fragment:fragment:1.0.0-rc02
|    |    +--- androidx.core:core:1.0.0-rc02 (*)
|    |    +--- androidx.legacy:legacy-support-core-ui:1.0.0-rc02
|    |    |    +--- androidx.annotation:annotation:1.0.0-rc02
|    |    |    +--- androidx.core:core:1.0.0-rc02 (*)
|    |    |    +--- androidx.legacy:legacy-support-core-utils:1.0.0-rc02 (*)
|    |    |    +--- androidx.customview:customview:1.0.0-rc02
|    |    |    |    +--- androidx.annotation:annotation:1.0.0-rc02
|    |    |    |    \--- androidx.core:core:1.0.0-rc02 (*)
|    |    |    +--- androidx.viewpager:viewpager:1.0.0-rc02
|    |    |    |    +--- androidx.annotation:annotation:1.0.0-rc02
|    |    |    |    +--- androidx.core:core:1.0.0-rc02 (*)
|    |    |    |    \--- androidx.customview:customview:1.0.0-rc02 (*)
|    |    |    +--- androidx.coordinatorlayout:coordinatorlayout:1.0.0-rc02
|    |    |    |    +--- androidx.annotation:annotation:1.0.0-rc02
|    |    |    |    +--- androidx.core:core:1.0.0-rc02 (*)
|    |    |    |    \--- androidx.customview:customview:1.0.0-rc02 (*)
|    |    |    +--- androidx.drawerlayout:drawerlayout:1.0.0-rc02
|    |    |    |    +--- androidx.annotation:annotation:1.0.0-rc02
|    |    |    |    +--- androidx.core:core:1.0.0-rc02 (*)
|    |    |    |    \--- androidx.customview:customview:1.0.0-rc02 (*)
|    |    |    +--- androidx.slidingpanelayout:slidingpanelayout:1.0.0-rc02
|    |    |    |    +--- androidx.annotation:annotation:1.0.0-rc02
|    |    |    |    +--- androidx.core:core:1.0.0-rc02 (*)
|    |    |    |    \--- androidx.customview:customview:1.0.0-rc02 (*)
|    |    |    +--- androidx.interpolator:interpolator:1.0.0-rc02
|    |    |    |    \--- androidx.annotation:annotation:1.0.0-rc02
|    |    |    +--- androidx.swiperefreshlayout:swiperefreshlayout:1.0.0-rc02
|    |    |    |    +--- androidx.annotation:annotation:1.0.0-rc02
|    |    |    |    +--- androidx.core:core:1.0.0-rc02 (*)
|    |    |    |    \--- androidx.interpolator:interpolator:1.0.0-rc02 (*)
|    |    |    +--- androidx.asynclayoutinflater:asynclayoutinflater:1.0.0-rc02
|    |    |    |    +--- androidx.annotation:annotation:1.0.0-rc02
|    |    |    |    \--- androidx.core:core:1.0.0-rc02 (*)
|    |    |    \--- androidx.cursoradapter:cursoradapter:1.0.0-rc02 (*)
|    |    +--- androidx.legacy:legacy-support-core-utils:1.0.0-rc02 (*)
|    |    +--- androidx.annotation:annotation:1.0.0-rc02
|    |    +--- androidx.loader:loader:1.0.0-rc02 (*)
|    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0-rc01
|    +--- androidx.vectordrawable:vectordrawable:1.0.0-rc02
|    |    +--- androidx.annotation:annotation:1.0.0-rc02
|    |    \--- androidx.core:core:1.0.0-rc02 (*)
|    \--- androidx.vectordrawable:vectordrawable-animated:1.0.0-rc02
|         +--- androidx.vectordrawable:vectordrawable:1.0.0-rc02 (*)
|         \--- androidx.legacy:legacy-support-core-ui:1.0.0-rc02 (*)
+--- androidx.annotation:annotation:1.0.0-rc02
+--- androidx.core:core:1.0.0-rc02 (*)
+--- androidx.collection:collection:1.0.0-rc02 (*)
+--- androidx.lifecycle:lifecycle-runtime:2.0.0-rc01 (*)
+--- androidx.lifecycle:lifecycle-common:2.0.0-rc01
+--- androidx.arch.core:core-common:2.0.0-rc01 (*)
+--- androidx.versionedparcelable:versionedparcelable:1.0.0-rc02 (*)
+--- androidx.cursoradapter:cursoradapter:1.0.0-rc02 (*)
+--- androidx.legacy:legacy-support-core-utils:1.0.0-rc02 (*)
+--- androidx.documentfile:documentfile:1.0.0-rc02 (*)
+--- androidx.loader:loader:1.0.0-rc02 (*)
+--- androidx.lifecycle:lifecycle-livedata-core:2.0.0-rc01 (*)
+--- androidx.arch.core:core-runtime:2.0.0-rc01 (*)
+--- androidx.lifecycle:lifecycle-viewmodel:2.0.0-rc01
+--- androidx.localbroadcastmanager:localbroadcastmanager:1.0.0-rc02 (*)
+--- androidx.print:print:1.0.0-rc02 (*)
+--- androidx.fragment:fragment:1.0.0-rc02 (*)
+--- androidx.legacy:legacy-support-core-ui:1.0.0-rc02 (*)
+--- androidx.customview:customview:1.0.0-rc02 (*)
+--- androidx.viewpager:viewpager:1.0.0-rc02 (*)
+--- androidx.coordinatorlayout:coordinatorlayout:1.0.0-rc02 (*)
+--- androidx.drawerlayout:drawerlayout:1.0.0-rc02 (*)
+--- androidx.slidingpanelayout:slidingpanelayout:1.0.0-rc02 (*)
+--- androidx.interpolator:interpolator:1.0.0-rc02 (*)
+--- androidx.swiperefreshlayout:swiperefreshlayout:1.0.0-rc02 (*)
+--- androidx.asynclayoutinflater:asynclayoutinflater:1.0.0-rc02 (*)
+--- androidx.vectordrawable:vectordrawable:1.0.0-rc02 (*)
+--- androidx.vectordrawable:vectordrawable-animated:1.0.0-rc02 (*)
+--- android.arch.navigation:navigation-fragment:1.0.0-alpha05
|    +--- android.arch.navigation:navigation-runtime:1.0.0-alpha05
|    |    +--- android.arch.navigation:navigation-common:1.0.0-alpha05
|    |    |    \--- androidx.core:core:1.0.0-rc01 -> 1.0.0-rc02 (*)
|    |    \--- androidx.legacy:legacy-support-core-utils:1.0.0-rc01 -> 1.0.0-rc02 (*)
|    \--- androidx.fragment:fragment:1.0.0-rc01 -> 1.0.0-rc02 (*)
+--- android.arch.navigation:navigation-runtime:1.0.0-alpha05 (*)
+--- android.arch.navigation:navigation-common:1.0.0-alpha05 (*)
+--- android.arch.navigation:navigation-ui:1.0.0-alpha05
|    +--- android.arch.navigation:navigation-runtime:1.0.0-alpha05 (*)
|    \--- com.google.android.material:material:1.0.0-rc01 -> 1.0.0-rc02
|         +--- androidx.annotation:annotation:1.0.0-rc02
|         +--- androidx.core:core:1.0.0-rc02 (*)
|         +--- androidx.legacy:legacy-support-core-ui:1.0.0-rc02 (*)
|         +--- androidx.legacy:legacy-support-core-utils:1.0.0-rc02 (*)
|         +--- androidx.fragment:fragment:1.0.0-rc02 (*)
|         +--- androidx.transition:transition:1.0.0-rc02
|         |    +--- androidx.annotation:annotation:1.0.0-rc02
|         |    \--- androidx.core:core:1.0.0-rc02 (*)
|         +--- androidx.appcompat:appcompat:1.0.0-rc02 (*)
|         +--- androidx.cardview:cardview:1.0.0-rc02
|         |    \--- androidx.annotation:annotation:1.0.0-rc02
|         \--- androidx.recyclerview:recyclerview:1.0.0-rc02
|              +--- androidx.annotation:annotation:1.0.0-rc02
|              +--- androidx.core:core:1.0.0-rc02 (*)
|              \--- androidx.legacy:legacy-support-core-ui:1.0.0-rc02 (*)
+--- com.google.android.material:material:1.0.0-rc02 (*)
+--- androidx.transition:transition:1.0.0-rc02 (*)
+--- androidx.cardview:cardview:1.0.0-rc02 (*)
+--- androidx.recyclerview:recyclerview:1.0.0-rc02 (*)
+--- android.arch.navigation:navigation-fragment-ktx:1.0.0-alpha05
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.2.50 -> 1.2.70 (*)
|    +--- android.arch.navigation:navigation-fragment:1.0.0-alpha05 (*)
|    \--- android.arch.navigation:navigation-runtime-ktx:1.0.0-alpha05
|         +--- org.jetbrains.kotlin:kotlin-stdlib:1.2.50 -> 1.2.70 (*)
|         +--- android.arch.navigation:navigation-runtime:1.0.0-alpha05 (*)
|         \--- android.arch.navigation:navigation-common-ktx:1.0.0-alpha05
|              +--- org.jetbrains.kotlin:kotlin-stdlib:1.2.50 -> 1.2.70 (*)
|              \--- android.arch.navigation:navigation-common:1.0.0-alpha05 (*)
+--- android.arch.navigation:navigation-runtime-ktx:1.0.0-alpha05 (*)
+--- android.arch.navigation:navigation-common-ktx:1.0.0-alpha05 (*)
+--- android.arch.navigation:navigation-ui-ktx:1.0.0-alpha05
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.2.50 -> 1.2.70 (*)
|    +--- android.arch.navigation:navigation-ui:1.0.0-alpha05 (*)
|    \--- android.arch.navigation:navigation-runtime-ktx:1.0.0-alpha05 (*)
+--- androidx.core:core-ktx:1.0.0-rc02
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.2.50 -> 1.2.70 (*)
|    +--- androidx.annotation:annotation:1.0.0-rc02
|    \--- androidx.core:core:1.0.0-rc02 (*)
+--- androidx.constraintlayout:constraintlayout:1.1.3
|    \--- androidx.constraintlayout:constraintlayout-solver:1.1.3
+--- androidx.constraintlayout:constraintlayout-solver:1.1.3
+--- io.reactivex.rxjava2:rxjava:2.2.0
|    \--- org.reactivestreams:reactive-streams:1.0.2
+--- org.reactivestreams:reactive-streams:1.0.2
+--- io.reactivex.rxjava2:rxandroid:2.1.0
|    \--- io.reactivex.rxjava2:rxjava:2.2.0 (*)
+--- io.reactivex.rxjava2:rxkotlin:2.3.0
|    +--- io.reactivex.rxjava2:rxjava:2.2.0 (*)
|    \--- org.jetbrains.kotlin:kotlin-stdlib:1.2.60 -> 1.2.70 (*)
+--- org.greenrobot:eventbus:3.1.1
+--- joda-time:joda-time:2.10
+--- com.squareup:javapoet:1.11.1
+--- androidx.room:room-runtime:2.0.0-rc01
|    +--- androidx.room:room-common:2.0.0-rc01
|    |    \--- androidx.annotation:annotation:1.0.0-rc01 -> 1.0.0-rc02
|    +--- androidx.sqlite:sqlite-framework:2.0.0-rc01
|    |    +--- androidx.annotation:annotation:1.0.0-rc01 -> 1.0.0-rc02
|    |    \--- androidx.sqlite:sqlite:2.0.0-rc01
|    |         \--- androidx.annotation:annotation:1.0.0-rc01 -> 1.0.0-rc02
|    +--- androidx.sqlite:sqlite:2.0.0-rc01 (*)
|    +--- androidx.arch.core:core-runtime:2.0.0-rc01 (*)
|    \--- androidx.legacy:legacy-support-core-utils:1.0.0-rc01 -> 1.0.0-rc02 (*)
+--- androidx.room:room-common:2.0.0-rc01 (*)
+--- androidx.sqlite:sqlite-framework:2.0.0-rc01 (*)
+--- androidx.sqlite:sqlite:2.0.0-rc01 (*)
+--- androidx.room:room-rxjava2:2.0.0-rc01
|    +--- io.reactivex.rxjava2:rxjava:2.0.6 -> 2.2.0 (*)
|    +--- androidx.room:room-common:2.0.0-rc01 (*)
|    +--- androidx.room:room-runtime:2.0.0-rc01 (*)
|    +--- androidx.arch.core:core-runtime:2.0.0-rc01 (*)
|    \--- androidx.legacy:legacy-support-core-utils:1.0.0-rc01 -> 1.0.0-rc02 (*)
+--- com.google.dagger:dagger:2.17
|    \--- javax.inject:javax.inject:1
+--- javax.inject:javax.inject:1
+--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.70 (*)
+--- project :base
|    +--- androidx.appcompat:appcompat:1.0.0-rc02 (*)
|    +--- android.arch.navigation:navigation-fragment:1.0.0-alpha05 (*)
|    +--- android.arch.navigation:navigation-ui:1.0.0-alpha05 (*)
|    +--- android.arch.navigation:navigation-fragment-ktx:1.0.0-alpha05 (*)
|    +--- android.arch.navigation:navigation-ui-ktx:1.0.0-alpha05 (*)
|    +--- androidx.core:core-ktx:1.0.0-rc02 (*)
|    +--- com.google.android.material:material:1.0.0-rc02 (*)
|    +--- androidx.constraintlayout:constraintlayout:1.1.3 (*)
|    +--- io.reactivex.rxjava2:rxjava:2.2.0 (*)
|    +--- io.reactivex.rxjava2:rxandroid:2.1.0 (*)
|    +--- io.reactivex.rxjava2:rxkotlin:2.3.0 (*)
|    +--- org.greenrobot:eventbus:3.1.1
|    \--- joda-time:joda-time:2.10
+--- com.squareup:javapoet:1.11.1
+--- androidx.room:room-runtime:2.0.0-rc01 (*)
+--- androidx.room:room-rxjava2:2.0.0-rc01 (*)
\--- com.google.dagger:dagger:2.17 (*)

Gradle 版本是 4.10.1。

我已经尝试了类似问题的所有建议,包括删除 gradle 缓存目录和无效/重新启动,没有任何帮助。

UPD。我注意到如果存在这两个依赖项,同步将失败:

implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"

我还应该尝试什么?

4

5 回答 5

3

所以我发现问题出在 Room 上:它使用旧版本的传递依赖。

我通过强制传递依赖版本来修复它:

implementation('androidx.annotation:annotation:1.0.0-rc02') {
    force = true
}

implementation('androidx.legacy:legacy-support-core-utils:1.0.0-rc02') {
    force = true
}

implementation("io.reactivex.rxjava2:rxjava:$rxjava_version") {
    force = true
}
于 2018-09-15T14:48:50.320 回答
2

我是同样的问题。所以当我把对本地库模块的依赖作为实现项目(':base')放在顶部时。喜欢

dependencies {

implementation project(':base')

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"


// Room
implementation "androidx.room:room-runtime:$room_version"

kapt "androidx.room:room-compiler:$room_version"

implementation "androidx.room:room-rxjava2:$room_version"
}

它对我有用。但不知道为什么会这样:)

更新

是的,我注意到这是因为android 持久化房间库,所以为了使其可行,请在模块build.gradle文件 中放入以下依赖行

.
.
.
// Test helpers for android support
testImplementation "android.arch.persistence.room:testing:$room_version"
.
.
// Test helpers for androidX
testImplementation "androidx.room:room-testing:$room_version"

希望,它有效

于 2019-04-03T07:29:25.437 回答
1

我建议更新你的 gradle

我对另一个依赖项也有同样的问题,Android Studio 中的默认 gradle 版本是 4.4,但我建议更新到 4.10.1。但另一个解决方案是清理你的项目

应用插件:'kotlin-kapt'很头疼。

默认 gradle 是旧的,新版本更好。

请参阅此链接:无法使用可执行文件 C:\Program Files\Java\jdk-10.0.1\bin\java.exe 确定 Java 版本

于 2018-09-14T22:51:56.887 回答
1

对我来说问题是这个导航

   implementation 'androidx.navigation:navigation-fragment:2.1.0'
   implementation 'androidx.navigation:navigation-ui:2.1.0'

所以我把它们改成

   implementation 'androidx.navigation:navigation-fragment:2.0.0'
   implementation 'androidx.navigation:navigation-ui:2.0.0'
于 2019-10-27T13:16:55.130 回答
0

我已经解决了这些错误。只需将一行应用到您的 build.gradle 文件并再次同步。希望能帮到大家

implementation 'org.jetbrains:annotations:16.0.2' 
于 2019-01-25T04:42:40.270 回答