Name = p.Select(s => s.User.Name).FirstOrDefault()
创建新项目后,color.xml文件包含一些未知字符。然后,我手动添加了此代码。
**Error is Here:**
Android resource compilation failed
Output: F:\UserApp\app\src\main\res\mipmap-anydpi-v26\ic_launcher.xml:1: error: not well-formed (invalid token).
Command: C:\Users\iAngkur\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\a5439741e2d1dbefbffc15295f5d15fb\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy \
-o \
F:\UserApp\app\build\intermediates\res\merged\debug \
F:\UserApp\app\src\main\res\mipmap-anydpi-v26\ic_launcher.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #2
此处有代码。
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<color name="colorPrimary">#0a091b</color>
<color name="colorPrimaryDark">#070716</color>
<color name="colorAccent">#FF4081</color>
</resources>
答案 0 :(得分:0)
您的问题似乎与此文件app\src\main\res\mipmap-anydpi-v26\ic_launcher.xml:1
您是否可以尝试像这样更新它(将可绘制图形更改为您自己的icon_launcher):
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@android:color/black"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>