Android添加依赖出现This support library should not use a different version (26) than the compile(25).
2017-09-16 16:54
435 查看
最近项目中要用到RecycleView,所以就想项目中添加了com.android.support:recyclerview-v7的依赖包,可是却出现了This
support library should not use a different version (26) than the compile(25).这个问题,后来查看了gradle文件才发现由于Android studio默认导入的是最新的依赖包所以导致依赖包的版本和compileSdkVersion版本不一致的问题,解决方案有两种:
1.把依赖包的版本修改的和compileSdkVersion的版本一致,比如我现在依赖包的版本是26,而compileSdkVersion的版本是25,所以我就可以把依赖包的版本改成25
:compile 'com.android.support:recyclerview-v7:25.0.0'注意在修改依赖包的版本的时候所修改的版本必须是以前出现过的某一个版本,不能是不存在的版本,比如我把依赖包的版本改成
compile 'com.android.support:recyclerview-v7:25.0.0-alpha1'就会出现Error:(30,
13) Failed to resolve: com.android.support:recyclerview-v7:25.0.0-alpha1因为并没有这麽一个版本存在。
2.把compileSdkVersion的版本改的和依赖包的版本一致,但是这也有一个问题,就是buildToolsVersion的版本也要修改的和compileSdkVersion的版本一致,不然在编辑xml文件时会出现问题。
以上就是解决依赖包和compileSdkVersion版本不一致的问题,希望对你有所帮助。
support library should not use a different version (26) than the compile(25).这个问题,后来查看了gradle文件才发现由于Android studio默认导入的是最新的依赖包所以导致依赖包的版本和compileSdkVersion版本不一致的问题,解决方案有两种:
1.把依赖包的版本修改的和compileSdkVersion的版本一致,比如我现在依赖包的版本是26,而compileSdkVersion的版本是25,所以我就可以把依赖包的版本改成25
:compile 'com.android.support:recyclerview-v7:25.0.0'注意在修改依赖包的版本的时候所修改的版本必须是以前出现过的某一个版本,不能是不存在的版本,比如我把依赖包的版本改成
compile 'com.android.support:recyclerview-v7:25.0.0-alpha1'就会出现Error:(30,
13) Failed to resolve: com.android.support:recyclerview-v7:25.0.0-alpha1因为并没有这麽一个版本存在。
2.把compileSdkVersion的版本改的和依赖包的版本一致,但是这也有一个问题,就是buildToolsVersion的版本也要修改的和compileSdkVersion的版本一致,不然在编辑xml文件时会出现问题。
以上就是解决依赖包和compileSdkVersion版本不一致的问题,希望对你有所帮助。
相关文章推荐
- This support library should not use a different version (25) than the compileSdkVersion
- This support library should not use a different version(x)than the compileSdkVersion(y)
- This support library should not use a different version (24) than the compileSdkVersion (23)...
- 关于This support library should not use a different version than the compilesdkversion
- Android Studio 使用教程(十五)之 This support library should not use a different version(x)than the compileS
- This support library should not use a different version
- 【完美解决系列】This support library should not use a different version
- eclipse创建android项目,无法正常预览布局文件,出现This version of the rendering library is more recent than your version of ADT plug-in. Please update ADT plug-in...
- layout下activity_main.xml无法显示界面出现This version of the rendering library is more recent than your versi
- This version of the rendering library is more recent than your version of Android Studio.
- 出现This version of the rendering library is more recent than your version of ADT plug-in. Please upda
- This version of the rendering library is more recent than your version of Android Studio. Please upd
- Error : should use android:showAsAction when not using support library
- 在新建android工程的时候出现This template depends on the Android Support library!
- 更新ADT20后出现This template depends on Android Support Library错误的解决办法
- This template depends on the Android Support library
- mac上安装eclipse出现Version 1.6.0_65 of the JVM is not suitable for this produc
- Android studio 运行出现Error running app: This version of Android Studio is incompatible with the Gradle
- Android导入eclipse项目出现Error: A library uses the same package as this project
- This version of the rendering library is more recent than your version of ADT plug-in. Please update