AAPT:错误: 内部元素必须是资源引用或空

问题描述 投票:0回答:1
Executing tasks: [:app:assembleDebug]

> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:compileDebugRenderscript UP-TO-DATE
> Task :app:checkDebugManifest UP-TO-DATE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:prepareLintJar UP-TO-DATE
> Task :app:generateDebugSources UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:mainApkListPersistenceDebug UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
  C:\Users\Hadi\AndroidStudioProjects\LightRecorder\app\src\main\res\values\ids.xml:3:5-50: AAPT: error: <item> inner element must either be a resource reference or empty.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 12s
9 actionable tasks: 1 executed, 8 up-to-date
java android gradle android-gradle build.gradle
1个回答
1
投票

我找到了 。当我升级我的android工作室时,我遇到了这个错误。我搜索了很多,最后我发现了它。只是我不得不改变值的ID

<resources>
<item name="name" type="id">ID</item>

<resources>
<item name="ID" type="id"/>

在那之后一切都被打破了,我希望它能用于你

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.