【发布时间】:2018-11-14 16:54:37
【问题描述】:
**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
新建项目后,color.xml 文件有一些未知字符。然后我手动添加了这段代码。
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<color name="colorPrimary">#0a091b</color>
<color name="colorPrimaryDark">#070716</color>
<color name="colorAccent">#FF4081</color>
</resources>
依赖代码在这里。
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
}
【问题讨论】:
-
查看“ic_launcher.xml”
-
你需要发布mipmap-anydpi-v26\ic_launcher.xml的内容
标签: android android-studio android-layout