使用情况:
列表
使用方法:
dependencies {
在这里添加:compile 'com.android.support:recyclerview-v7:+'//即可引用最新版本的recyclerView
}
但是新建项目 一般会出现这种情况:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1' //这一行会报红!……………………
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:recyclerview-v7:+'
}
compile 'com.android.support:appcompat-v7:25.3.1'
这一行会报红,只是版本声明的问题,这时候就需要将recyclerView的引用版本,和appcompat的版本一直就可以了。
将recyclerView的引用改成:(就是将 + 号改成appcompat的版本号就可以)
compile 'com.android.support:recyclerview-v7:25.3.1'
本文介绍了解决Android项目中版本冲突的具体方法,特别是如何调整RecyclerView和AppCompat的版本来避免错误提示。
103

被折叠的 条评论
为什么被折叠?



