Android Error:AAPT: error: resource android:attr/colorError not found

Android resource linking failed
G:\work\viewPager\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:622: error: resource color/colorPrimary (aka com.example.viewpager:color/colorPrimary) not found.
G:\work\viewPager\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:623: error: resource color/colorPrimaryDark (aka com.example.viewpager:color/colorPrimaryDark) not found.
G:\work\viewPager\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:624: error: resource color/colorAccent (aka com.example.viewpager:color/colorAccent) not found.
error: failed linking references.

原因

compileSdkVersion 25 低于 implementation 'com.android.support:appcompat-v7:27.0.0’的support版本。
sdk编译版本低于support包的版本一般就会报这个错,当然并不是绝对的,一般是高版本的support包中的资源文件在底版本sdk中找不到的时候才会报错。

解决

将compileSdkVersion版本改为与support一致,建议改为compileSdkVersion 27

你可能感兴趣的:(#,Android,Error笔记,aapt)