Android resource linking failed
ERROR:E:\software\Developer\APP\GaoDeTest2\app\src\main\res\values\themes.xml:3:5-9:13: AAPT: error: resource color/purple_500 (aka com.example.gaodetest2:color/purple_500) not found.
ERROR:E:\software\Developer\APP\GaoDeTest2\app\src\main\res\values\themes.xml:3:5-9:13: AAPT: error: resource color/purple_700 (aka com.example.gaodetest2:color/purple_700) not found.
ERROR:E:\software\Developer\APP\GaoDeTest2\app\src\main\res\values\themes.xml:3:5-9:13: AAPT: error: resource color/teal_200 (aka com.example.gaodetest2:color/teal_200) not found.
ERROR:E:\software\Developer\APP\GaoDeTest2\app\src\main\res\values-night\themes.xml:3:5-9:13: AAPT: error: resource color/purple_200 (aka com.example.gaodetest2:color/purple_200) not found.
ERROR:E:\software\Developer\APP\GaoDeTest2\app\src\main\res\values-night\themes.xml:3:5-9:13: AAPT: error: resource color/purple_700 (aka com.example.gaodetest2:color/purple_700) not found.
ERROR:E:\software\Developer\APP\GaoDeTest2\app\src\main\res\values-night\themes.xml:3:5-9:13: AAPT: error: resource color/teal_200 (aka com.example.gaodetest2:color/teal_200) not found.
这种类型的错误可能是由于编辑了color.xml时,删除了创建时候系统自动生成的颜色类型而导致的。
解决:
根据提示,在color.xml中把颜色类型补上,以我这个为例子,就是在color.xml里加入
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
如果你缺的是其他颜色,你可以百度一下。