首页 > 解决方案 > 资源编译失败

问题描述

我使用 Android Studio 3.2 并且我已经完成了一个 firebase 连接,以连接到我正在构建的应用程序的寄存器部分。

这是我看到错误的屏幕截图:https ://imgur.com/a/GN72eL8 & https://imgur.com/a/kwxA2sH

Android resource compilation failed
Output:  C:\Users\ERIK\AndroidStudioProjects\FirebaseAuthDemo\app\src\main\res\mipmap-anydpi-v26\ic_launcher.xml:12: error: not well-formed (invalid token).

Command: C:\Users\ERIK\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\92d92d266c9089a895db65475d7e7f04\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy \
        -o \
        C:\Users\ERIK\AndroidStudioProjects\FirebaseAuthDemo\app\build\intermediates\res\merged\debug \
        C:\Users\ERIK\AndroidStudioProjects\FirebaseAuthDemo\app\src\main\res\mipmap-anydpi-v26\ic_launcher.xml
Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #1

标签: android-studio

解决方案


您的/res/mipmap-anydpi-v26/ic_launcher.xml文件在第 12 行不正确。这通常是由不正确的字符引起的,例如分号或句号。

如果您想要快速修复,可以删除此文件,否则打开文件查看编译器在第 12 行突出显示的问题。如果您无法找出问题所在,请使用文件内容和任何其他内容编辑您的问题错误。


推荐阅读