【问题标题】:AAPT: error: <item> inner element must either be a resource reference or emptyAAPT:错误:<item> 内部元素必须是资源引用或为空
【发布时间】:2019-03-01 11:04:19
【问题描述】:
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-plugin build.gradle


【解决方案1】:

我找到了。当我升级我的 android studio 之类的东西时,我遇到了那个错误。我搜索了很多,终于找到了。只是我不得不更改值中的 id

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

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

在那之后一切都成真了 希望对你有用

【讨论】:

  • 解决了同样的问题……不知道为什么会这样
猜你喜欢
  • 2019-03-11
  • 2023-03-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-08-19
  • 1970-01-01
  • 2022-10-18
相关资源
最近更新 更多