问题描述
所以我将我的 Android Studio 更新到了 v3.2.当我尝试编译项目时,构建失败.以下是错误:
So I updated my Android Studio to v3.2. When I tried compiling the project, build fails.Below is the error:
Android resource compilation failed
Output: C:\Users\Ashish\AndroidStudioProjects\StartUp\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:900: error: <item> inner element must either be a resource reference or empty.
Command: C:\Users\Ashish\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\7f1fbe9171e916e5044000cd76b749c8\aapt2-3.2.0-4818971-windows\aapt2.exe compile --legacy \
-o \
C:\Users\Ashish\AndroidStudioProjects\StartUp\app\build\intermediates\res\merged\debug \
C:\Users\Ashish\AndroidStudioProjects\StartUp\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Daemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #0
请告知是否需要更多信息.任何帮助将不胜感激.
Please do tell if there is any more information required. Any help will be appreciated.
推荐答案
我今天在将 gradle 从 3.1.4
更新到 3.2.0
后遇到了这个问题.我不知道为什么,但是构建开始抛出该异常.我删除了 build
文件夹,并删除了 gradle caches
文件夹但没有任何效果,所以我查看了合并的 values.xml
并发现我的 ids.xml
定义了一个错误的 ID,该 ID 被合并到 values.xml
:
I was facing this issue today after updating gradle from 3.1.4
to 3.2.0
. I don't know why, but the build started to throw that exception. i deleted the build
folder, and deleted the gradle caches
folder but nothing worked, so i looked at the merged values.xml
and turns out that my ids.xml
was defining a wrong id that was being merged to the values.xml
:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="downloading_package" type="id">Baixando pacote de sincronização</item>
</resources>
显然这在更新之前有效......就我而言,我删除了 ids.xml
文件(它在项目中没用)
And apparently this was working before the update... for my case i deleted the ids.xml
file (it was useless in the project)
我希望我能知道为什么在更新之前一切正常
这篇关于Android 资源编译失败 v3.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!