android 编译报错
ERROR:/Users/xxxxx/WebViewDemo/app/src/main/res/layout/activity_main.xml:14: AAPT: error: '2D97CB' is incompatible with attribute background (attr) reference|color.
问题情形描述:
书写好了 UI 但是运行的时候直接报错了
问题分析(由于直接指定了代码文件和行数, 很好定位问题):
error: ‘XXXX’ is incompatible with attribute android:background (attr) reference|color.
一般是该加的占位符没有加, 例如:
颜色:#2D97CB 少写一位
drawable 没有加@引用
修复后的代码如下:
android:background="#2D97CB" // 加上 #
或者
android:src="@drawable/abc_vector_test"/> //加上 @
End