This support library should not use a different version (24) than the compileSdkVersion (28)

报错:This support library should not use a different version (24) than the compileSdkVersion (28) less... (Ctrl+F1) 
There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion).  Issue id: GradleCompatibl

出现原因:在学习《第一行代码》中的RecycleView时,往build.gradle中添加依赖库的时候出现错误,添加内容是

compile'com.android.support:recyclerview-v7:24.2.1'

其实翻译下报错英文猜测是因为我的SDK版本已经到28了,不能用低版本的依赖库,所以改成和我版本相同的就解决了

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

---记录菜鸟学习过程中的点点滴滴

猜你喜欢

转载自blog.csdn.net/yanmuchen/article/details/85063388