找不到"androidx.arch","androidx.room"等版本 [英] Cannot find version of 'androidx.arch', 'androidx.room', etc

查看:509
本文介绍了找不到"androidx.arch","androidx.room"等版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试构建android应用程序时遇到以下问题.我遇到了一些关于强制或使用手动依赖项解析策略的android帖子.这似乎无法解决问题.

I am experiencing the following issue when trying to build an android application. I have come across some android post on forcing or using a manual dependency resolution strategy. This does not seem to solve the problem.

有人问过类似的问题:

A similar issue has been asked : Similar stack overflow question.

还打开了一个问题:有关类似问题的问题跟踪器.

* What went wrong:
Execution failed for task ':app:lintVitalSunmiRelease'.
> Could not resolve all artifacts for configuration ':data:debugAndroidTestRuntimeClasspath'.
   > Could not resolve androidx.arch.core:core-runtime:2.0.1-alpha01.
     Required by:
         project :data
      > Cannot find a version of 'androidx.arch.core:core-runtime' that satisfies the version constraints: 
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-testing:2.1.0-alpha06' --> 'androidx.arch.core:core-runtime:2.0.1'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha03' --> 'androidx.arch.core:core-runtime:2.0.1-alpha01'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-rxjava2:2.0.0-rc01' --> 'androidx.arch.core:core-runtime:2.0.0-rc01'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.1.0-alpha06' --> 'androidx.arch.core:core-runtime:2.0.1'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-testing:2.1.0-alpha06' --> 'androidx.room:room-runtime:2.1.0-alpha06' --> 'androidx.arch.core:core-runtime:2.0.1'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha03' --> 'androidx.lifecycle:lifecycle-livedata:2.1.0-alpha03' --> 'androidx.arch.core:core-runtime:2.0.1-alpha01'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha03' --> 'androidx.lifecycle:lifecycle-livedata:2.1.0-alpha03' --> 'androidx.lifecycle:lifecycle-livedata-core:2.1.0-alpha03' --> 'androidx.arch.core:core-runtime:2.0.1-alpha01'
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.arch.core:core-runtime' strictly '2.0.1-alpha01' because of the following reason: debugRuntimeClasspath uses version 2.0.1-alpha01
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.arch.core:core-runtime' strictly '2.0.1-alpha01' because of the following reason: debugRuntimeClasspath uses version 2.0.1-alpha01
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.arch.core:core-runtime' strictly '2.0.1-alpha01' because of the following reason: debugRuntimeClasspath uses version 2.0.1-alpha01

   > Could not resolve androidx.room:room-runtime:2.0.0-rc01.
     Required by:
         project :data
      > Cannot find a version of 'androidx.room:room-runtime' that satisfies the version constraints: 
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-testing:2.1.0-alpha06' --> 'androidx.room:room-runtime:2.1.0-alpha06'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-rxjava2:2.0.0-rc01' --> 'androidx.room:room-runtime:2.0.0-rc01'    

   > Could not resolve androidx.sqlite:sqlite:2.0.0-rc01.
     Required by:
         project :data
      > Cannot find a version of 'androidx.sqlite:sqlite' that satisfies the version constraints: 
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-testing:2.1.0-alpha06' --> 'androidx.sqlite:sqlite:2.0.1'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.1.0-alpha06' --> 'androidx.sqlite:sqlite:2.0.1'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-testing:2.1.0-alpha06' --> 'androidx.room:room-runtime:2.1.0-alpha06' --> 'androidx.sqlite:sqlite:2.0.1'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-testing:2.1.0-alpha06' --> 'androidx.sqlite:sqlite-framework:2.0.1' --> 'androidx.sqlite:sqlite:2.0.1'
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.sqlite:sqlite' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.sqlite:sqlite' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.sqlite:sqlite' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01

   > Could not resolve android.arch.persistence.room:runtime:1.1.1.
     Required by:
         project :data
      > Cannot find a version of 'androidx.room:room-runtime' that satisfies the version constraints: 
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-testing:2.1.0-alpha06' --> 'androidx.room:room-runtime:2.1.0-alpha06'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-rxjava2:2.0.0-rc01' --> 'androidx.room:room-runtime:2.0.0-rc01'

   > Could not resolve androidx.room:room-common:2.1.0-alpha06.
     Required by:
         project :data > androidx.room:room-testing:2.1.0-alpha06
         project :data > androidx.room:room-runtime:2.1.0-alpha06
         project :data > androidx.room:room-testing:2.1.0-alpha06 > androidx.room:room-migration:2.1.0-alpha06
      > Cannot find a version of 'androidx.room:room-common' that satisfies the version constraints: 
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-testing:2.1.0-alpha06' --> 'androidx.room:room-common:2.1.0-alpha06'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-rxjava2:2.0.0-rc01' --> 'androidx.room:room-common:2.0.0-rc01'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.1.0-alpha06' --> 'androidx.room:room-common:2.1.0-alpha06'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-testing:2.1.0-alpha06' --> 'androidx.room:room-runtime:2.1.0-alpha06' --> 'androidx.room:room-common:2.1.0-alpha06'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-testing:2.1.0-alpha06' --> 'androidx.room:room-migration:2.1.0-alpha06' --> 'androidx.room:room-common:2.1.0-alpha06'
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-common' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-common' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-common' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01

   > Could not resolve androidx.room:room-runtime:2.1.0-alpha06.
     Required by:
         project :data > androidx.room:room-testing:2.1.0-alpha06
      > Cannot find a version of 'androidx.room:room-runtime' that satisfies the version constraints: 
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-testing:2.1.0-alpha06' --> 'androidx.room:room-runtime:2.1.0-alpha06'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-rxjava2:2.0.0-rc01' --> 'androidx.room:room-runtime:2.0.0-rc01'    

   > Could not resolve androidx.arch.core:core-runtime:2.0.1.
     Required by:
         project :data > androidx.room:room-testing:2.1.0-alpha06
         project :data > androidx.room:room-runtime:2.1.0-alpha06
      > Cannot find a version of 'androidx.arch.core:core-runtime' that satisfies the version constraints: 
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-testing:2.1.0-alpha06' --> 'androidx.arch.core:core-runtime:2.0.1'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha03' --> 'androidx.arch.core:core-runtime:2.0.1-alpha01'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-rxjava2:2.0.0-rc01' --> 'androidx.arch.core:core-runtime:2.0.0-rc01'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.1.0-alpha06' --> 'androidx.arch.core:core-runtime:2.0.1'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-testing:2.1.0-alpha06' --> 'androidx.room:room-runtime:2.1.0-alpha06' --> 'androidx.arch.core:core-runtime:2.0.1'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha03' --> 'androidx.lifecycle:lifecycle-livedata:2.1.0-alpha03' --> 'androidx.arch.core:core-runtime:2.0.1-alpha01'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha03' --> 'androidx.lifecycle:lifecycle-livedata:2.1.0-alpha03' --> 'androidx.lifecycle:lifecycle-livedata-core:2.1.0-alpha03' --> 'androidx.arch.core:core-runtime:2.0.1-alpha01'
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.arch.core:core-runtime' strictly '2.0.1-alpha01' because of the following reason: debugRuntimeClasspath uses version 2.0.1-alpha01
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.arch.core:core-runtime' strictly '2.0.1-alpha01' because of the following reason: debugRuntimeClasspath uses version 2.0.1-alpha01
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.arch.core:core-runtime' strictly '2.0.1-alpha01' because of the following reason: debugRuntimeClasspath uses version 2.0.1-alpha01

   > Could not resolve androidx.arch.core:core-runtime:2.0.1-alpha01.
     Required by:
         project :data > androidx.lifecycle:lifecycle-extensions:2.1.0-alpha03
         project :data > androidx.lifecycle:lifecycle-livedata:2.1.0-alpha03
         project :data > androidx.lifecycle:lifecycle-livedata-core:2.1.0-alpha03
      > Cannot find a version of 'androidx.arch.core:core-runtime' that satisfies the version constraints: 
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-testing:2.1.0-alpha06' --> 'androidx.arch.core:core-runtime:2.0.1'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha03' --> 'androidx.arch.core:core-runtime:2.0.1-alpha01'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-rxjava2:2.0.0-rc01' --> 'androidx.arch.core:core-runtime:2.0.0-rc01'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.1.0-alpha06' --> 'androidx.arch.core:core-runtime:2.0.1'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-testing:2.1.0-alpha06' --> 'androidx.room:room-runtime:2.1.0-alpha06' --> 'androidx.arch.core:core-runtime:2.0.1'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha03' --> 'androidx.lifecycle:lifecycle-livedata:2.1.0-alpha03' --> 'androidx.arch.core:core-runtime:2.0.1-alpha01'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha03' --> 'androidx.lifecycle:lifecycle-livedata:2.1.0-alpha03' --> 'androidx.lifecycle:lifecycle-livedata-core:2.1.0-alpha03' --> 'androidx.arch.core:core-runtime:2.0.1-alpha01'
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.arch.core:core-runtime' strictly '2.0.1-alpha01' because of the following reason: debugRuntimeClasspath uses version 2.0.1-alpha01
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.arch.core:core-runtime' strictly '2.0.1-alpha01' because of the following reason: debugRuntimeClasspath uses version 2.0.1-alpha01
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.arch.core:core-runtime' strictly '2.0.1-alpha01' because of the following reason: debugRuntimeClasspath uses version 2.0.1-alpha01


   > Could not resolve androidx.room:room-runtime:2.0.0-rc01.
     Required by:
         project :data > androidx.room:room-rxjava2:2.0.0-rc01
      > Cannot find a version of 'androidx.room:room-runtime' that satisfies the version constraints: 
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Constraint path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime' strictly '2.0.0-rc01' because of the following reason: debugRuntimeClasspath uses version 2.0.0-rc01
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-runtime:2.0.0-rc01' because of the following reason: ENABLE_JETIFIER is enabled
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-testing:2.1.0-alpha06' --> 'androidx.room:room-runtime:2.1.0-alpha06'
           Dependency path 'shopperapp:data:unspecified' --> 'androidx.room:room-rxjava2:2.0.0-rc01' --> 'androidx.room:room-runtime:2.0.0-rc01'    

gradle文件如下:

The gradle file is as follows:

buildscript {
    repositories {
        google()
        maven { url 'https://maven.fabric.io/public' }
        mavenCentral()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'
        classpath 'io.fabric.tools:gradle:1.28.1'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    google()
    maven { url 'https://maven.fabric.io/public' }
    maven { url 'https://jitpack.io' }
    mavenCentral()
    jcenter()

    flatDir {
        dirs 'libs'
    }
}

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"

    flavorDimensions "default"

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    splits {
        abi {
            enable true
            reset()
            include buildABI
            universalApk false
        }
    }

    defaultConfig {

        multiDexEnabled true
        applicationId "myappid.com"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode build_version_code as Integer
        versionName build_version
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    lintOptions {
        abortOnError false
    }
}

configurations.all {
    resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}

dependencies {
    implementation(name: 'PayLib-release', ext: 'aar')
    implementation fileTree(dir: 'libs', include: ['*.jar', '*.arr'])
    implementation 'com.sunmi:sunmiui:1.1.22'

    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1', {
        exclude group: 'com.android.support', module: 'support-annotations'
        androidTestImplementation 'com.android.support:support-annotations:25.3.1'
        androidTestImplementation 'com.android.support.test:runner:0.5'
    })
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.6@aar') {
        transitive = true
    }
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'
    implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0-alpha01'
    implementation 'androidx.media:media:1.1.0-alpha03'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.android.material:material:1.1.0-alpha05'
    implementation 'com.google.firebase:firebase-core:16.0.7'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
    implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha03'
    implementation 'androidx.percentlayout:percentlayout:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    testImplementation 'junit:junit:4.12'
    implementation project(':data')
    implementation 'com.github.Kunzisoft:Android-SwitchDateTimePicker:2.0'

    // RxJava
    implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
    implementation 'io.reactivex.rxjava2:rxjava:2.2.7'
    implementation "com.jakewharton.rxbinding2:rxbinding:2.0.0"
}
apply plugin: 'com.google.gms.google-services'

有人能够解决此问题吗?

Has anybody been able to resolve this issue?

推荐答案

最适合我的解决方案是使用依赖项解决策略:

The solution that worked for me was to use a dependency resolution strategy:

因此,对于项目需要突出显示的每个项目,我都添加了依赖项解析:

So for each item that has been highlighted that the project requires, I have added to my dependency resolution:

configurations.all
            {
                resolutionStrategy.eachDependency { details ->
                    if (details.requested.group == 'androidx.room'
                            && !details.requested.name.contains('room-runtime')) {
                        details.useVersion "2.1.0-alpha04"
                    }
                    if (details.requested.group == 'androidx.room'
                            && !details.requested.name.contains('room-testing')) {
                        details.useVersion "2.1.0-alpha04"
                    }
                    if (details.requested.group == 'androidx.room'
                            && !details.requested.name.contains('room-rxjava2')) {
                        details.useVersion "2.1.0-alpha04"
                    }
                    if (details.requested.group == 'androidx.room'
                            && !details.requested.name.contains('room-common')) {
                        details.useVersion "2.1.0-alpha04"
                    }
                    if (details.requested.group == 'androidx.room'
                            && !details.requested.name.contains('room-migration')) {
                        details.useVersion "2.1.0-alpha04"
                    }
                    if (details.requested.group == 'androidx.room'
                            && !details.requested.name.contains('room-compiler')) {
                        details.useVersion "2.1.0-alpha04"
                    }
                }
            } 

我在这里说过,他们应该使用版本2.1.0-alpha04,因为版本2.1.0-alpha06似乎有第一手经验的问题,并在另一篇文章中提到:注意:无法读取... etc的get kotlin元数据,并且无法键入转换器

Here I have stated that they should use version 2.1.0-alpha04 as it seems that version 2.1.0-alpha06 has issues from firsthand experiences as well as stated in another post: Room persistence library (dependency issue), MVVM design pattern and Note: Failed to read get kotlin metadata for ...etc, and type converter

这篇关于找不到"androidx.arch","androidx.room"等版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆