在构建上获得此错误:
:app:processDebugResources / app / src / main / res / mipmap-anydpi-v26 / ic_launcher.xml:3:AAPT:error:resource color / ic_launcher_background(aka com.example.app:color/ic_launcher_background)not found。 /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:4:AAPT:错误:找不到资源mipmap / ic_launcher_foreground(又名com.example.app:mipmap/ic_launcher_foreground)。
<platform name="android">
...
<resource-file src="res/android/mipmap-anydpi-v26/ic_launcher.xml" target="app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" />
<resource-file src="res/android/mipmap-anydpi-v26/ic_launcher_round.xml" target="app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" />
..
</platform>
ic_launcher.xml
和ic_launcher_round.xml
的内容
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
values
(res / android / values)文件夹包含colors.xml, ic_launcher_background.xml, strings.xml, styles.xml
但是没有被认可。
The values (res/android/values) folder contains colors.xml, ic_launger_background.xml, strings.xml, styles.xml
注意到ic_launger_background.xml,它不是ic_launcher_foreground,请检查一下。