编译时Error retrieving parent for item: No resource found that matches the given name的问题

第一次遇到这样的问题,蒙蔽一脸,这里记录

报 Error:Error retrieving parent for item: No resource found that matches the given name “xxxxxxxxxx”

过程就不说了,直接来解决方法(个人解决的方法)

找到项目中Gradle Script

打开这个

解决前

compileSdkVersion 21

​​​​​​​implementation 'com.android.support:appcompat-v7:25.3.0'//就是这个
implementation 'com.android.support:cardview-v7:21.0.3'
implementation 'com.android.support:recyclerview-v7:21.0.3'
implementation 'com.android.support:support-v4:21.0.3'

改动后

compileSdkVersion 21

​​​​​​​implementation 'com.android.support:appcompat-v7:21.0.3'//改动后
implementation 'com.android.support:cardview-v7:21.0.3'
implementation 'com.android.support:recyclerview-v7:21.0.3'
implementation 'com.android.support:support-v4:21.0.3'

必须要

compileSdkVersion 21
​​​​​​​implementation 'com.android.support:appcompat-v7:21.0.3'

这两个一致,然后再编译就正常了,小细节需要特别注意。

你可能感兴趣的:(Android)