Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
E:\git_code\helloapp\app\src\main\res\layout\activity_main.xml:2: error: resource color/green (aka com.wm.helloapp:color/green) not found.
E:\git_code\helloapp\app\src\main\res\layout\activity_main.xml:9: error: resource color/white (aka com.wm.helloapp:color/white) not found.
在res/values/colors.xml里加
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="colorPrimary">#008577</color> <color name="colorPrimaryDark">#00574B</color> <color name="colorAccent">#D81B60</color> <color name="red">#FF0000</color> <color name="green">#4CAF50</color> <color name="white">#FFFFFF</color> </resources>