代码之家  ›  专栏  ›  技术社区  ›  artem

无法解析“”的依赖项:feature@debugFeature/compileClasspath':无法解析androidx.0注释:一个说明:1.0.0-rc01

  •  3
  • artem  · 技术社区  · 6 年前

    在将Android Studio更新为3.3金丝雀10(从以前的金丝雀)之后,我开始发现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 (*)
    

    渐变版本是4.10.1。

    我试过类似问题的每一个建议,包括删除gradle caches目录和Invalidate/Restart,没有任何帮助。

    升级。 我注意到,如果存在以下两个依赖项,同步就会失败:

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

    我还应该试试什么?

    4 回复  |  直到 6 年前
        1
  •  3
  •   artem    6 年前

    所以我发现问题出在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
    }
    
        2
  •  2
  •   Ramesh Pokharel    5 年前

    我也有同样的问题。所以当我把依赖关系放在一个本地库模块上 顶部的实现项目(':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"
    }
    

    更新

    是的,我注意到这是因为 为了使之可行,请在模块中添加以下依赖项行 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"
    

        3
  •  1
  •   Aarón Lucker    6 年前

    我建议更新你的gradle

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

    应用插件:“kotlin kapt” 很头痛。

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

    Could not determine Java version using executable C:\Program Files\Java\jdk-10.0.1\bin\java.exe

        4
  •  1
  •   Bercove    5 年前

    对我来说,问题是这个导航

       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'
    
        5
  •  0
  •   LOCPT    5 年前

    implementation 'org.jetbrains:annotations:16.0.2' 
    
    推荐文章