Appcompat 和 Recyclerview 版本差异

Appcompat and Recyclerview versions difference

提问人:sleepy 提问时间:9/2/2019 最后编辑:Gabriele Mariottisleepy 更新时间:6/18/2020 访问量:103

问:

我只是从 Android Studio 创建一个项目,gradle 文件如下所示,

问题是,appcompat 和 recyclerview 应该是相同的版本,我猜,我尝试了很多东西,但找不到相同的版本。

我该如何解决这个问题?

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
Android Kotlin android-gradle-plugin android-support-library androidx

评论


答:

0赞 Gabriele Mariotti 9/2/2019 #1

使用 androidx 版本(而不是支持库版本)。
您可以使用:

androidx.recyclerview:recyclerview:1.1.0-beta03

androidx.recyclerview:recyclerview:1.0.0

而不是

implementation 'com.android.support:recyclerview-v7:28.0.0'

评论

0赞 sleepy 9/2/2019
谢谢加布里埃尔!所以使用appcombat的不同版本不会有问题吗?
0赞 Gabriele Mariotti 9/2/2019
不,至少目前没有。