本文介绍了所有AndroidX版本均与编译不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将项目迁移到AndroidX,原因是我遇到了一些错误,但是现在我收到了一个错误循环,表明androidX类的版本与编译版本不同:

I've migrated my project to AndroidX cause i was having some errors, but now i'm receiving a loop of errors that the androidX class has a different version from the compile:

Android dependency 'androidx.fragment:fragment' has different version for the compile (1.0.0-rc01) and runtime (1.1.0-alpha04) classpath. You should manually set the same version via DependencyResolution

它总是一个与众不同的类,我已经尝试过实现此代码,但是每次我添加一行代码时,它都会给我另一个不同于编译的类:

And it's always a different a class, i've already tried implementing this code but every time i add a line it gives me other class different from the compile:

configurations.all {
    resolutionStrategy {
        force 'androidx.fragment:fragment:v4:1.1.0-alpha04'
    }
}

推荐答案

我已解决了在gradle.properties中将项目迁移到androidX并通过Refactor =>迁移到AndroidX并将此代码添加到我的应用程序/中的错误build.gradle:

I've resolved my error migrating my project to androidX in gradle.properties, and by Refactor => Migrate to AndroidX, and adding this code to my app/build.gradle:

configurations {
    all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}

这篇关于所有AndroidX版本均与编译不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 08:30