-Q: 错误<item>内部元素必须是资源引用或空

升级Andriod Studio之后编译发现如下错误

Android resource compilation failed
***\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:442:
error: <item> inner element must either be a resource reference or empty.

Android资源编译失败内部元素必须是资源引用或空

打开报错文件,查看442行发现如下内容

···
<item name="webviewload_monitor_cancel_point" type="id">webviewload_monitor_cancel_point</item>
····

-A(1): 错误<item>内部元素必须是资源引用或空

  • 如果是自己的文件
    直接找到文件后去掉里面的内容,改为下面这样就对了
<item name="webviewload_monitor_cancel_point" type="id"/>
  • 如果不是自己的文件自己没办法去改
    临时解决办法是gradle.properties中添加如下配置
android.enableAapt2=false

㊟ :这个方法2018年结束之后随着版本更新就没有办法使用了,编译时提示如下

WARNING: The following project options are deprecated and have been removed:
android.enableAapt2
This property has no effect, AAPT2 is now always used.

顺便呢你就让人家去改去吧(夺命催更๑乛◡乛๑)这中间需要时间就不确定了,现如今已经是2019年了上面的方法已经失效那该怎么办呢?

-A(2):修改第三方文件的错误<item>内部元素必须是资源引用或空

其实呢咱也没必要等着人家去改,咱们可以借助gradle中的resValue这个方法去修改编译中的文件

resValue "id", "webviewload_monitor_cancel_point",""

这样就把之前有问题的内容覆盖掉了。

解决问题 inner element must either be a resource reference or empty.的更多相关文章

  1. error: <item> inner element must either be a resource reference or empty.

    FAQ: Android resource compilation failedOutput: /home/cmm/code/AndroidHttpCapture/app/build/intermed ...

  2. How do I duplicate a resource reference in code behind in WPF?如何在WPF后台代码中中复制引用的资源?

    原文 https://stackoverflow.com/questions/28240528/how-do-i-duplicate-a-resource-reference-in-code-behi ...

  3. Illegal resource reference: @*android resources are private and not always present

    0:前言 在android开发中,当使用别人的代码的时候,在style.xml中有此种错误 1:解决方案 删除*星号

  4. Android resource compilation failed

    报错:Android resource compilation failed D:\android\EasySports\app\build\intermediates\incremental\mer ...

  5. Layout Resource官方教程(1)简介

    Layout Resource SEE ALSO Layouts A layout resource defines the architecture for the UI in an Activit ...

  6. Drawable(3)Color State List Resource

    注意 Color State List Resource 与 Color不同,前者是颜色状态表.根据不同状态显示不同颜色,它是State list,里面有多种颜色,后者只是一个颜色. Color St ...

  7. Drawable(2)State list Drawable Resource介绍

    State List A StateListDrawable is a drawable object defined in XML that uses a several different ima ...

  8. Learning Puppet — Resource Ordering

    Learning Puppet — Resource Ordering Learn about dependencies and refresh events, manage the relation ...

  9. Android Resource介绍和使用

    1. 相关文件夹介绍 文件 取值方式 string.xml getResource().getString(resourceId)或者getResource().getText(resourceId) ...

随机推荐

  1. 【postman】api开发必备神器

    1.使用参考:https://blog.csdn.net/fxbin123/article/details/80428216 2.win 下载地址:Postman for windows X64    ...

  2. tmp 字典合并

    tmp  

  3. Post Setting Proxy 设置 代理

    postman的代理使用篇(四) - codingstudy - SegmentFault 思否https://segmentfault.com/a/1190000012024844 postman ...

  4. node 报错 env: node\r: No such file or directory

    最近在编写一个命令行工具.使用 npm link 时可以正常运行.但是 ctrl+s 保存后, 再运行则报错 env: node\r: No such file or directory ,需要再 n ...

  5. [LeetCode] 167. Two Sum II - Input array is sorted 两数和 II - 输入是有序的数组

    Given an array of integers that is already sorted in ascending order, find two numbers such that the ...

  6. [LeetCode] 225. Implement Stack using Queues 用队列来实现栈

    Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. po ...

  7. [LeetCode] 314. Binary Tree Vertical Order Traversal 二叉树的垂直遍历

    Given a binary tree, return the vertical order traversal of its nodes' values. (ie, from top to bott ...

  8. [LeetCode] 377. Combination Sum IV 组合之和 IV

    Given an integer array with all positive numbers and no duplicates, find the number of possible comb ...

  9. Oracle Spatial分区应用研究之一:分区与分表查询性能对比

    1.名词解释 分区:将一张大表在物理上分成多个分区,逻辑上仍然是同一个表名. 分表:将一张大表拆分成多张小表,不同表有不同的表名. 两种数据组织形式的原理图如下: 图 1分表与分区的原理图 2.实验目 ...

  10. 【C++札记】函数重载

    概述 函数重载指在相同作用域中多个函数名相同,函数的形参不同. 遵循规则: 1.函数名相同 2.函数的参数,类型,个数或顺序不一样都可以构成重载. 3.函数返回值得类型不同不构成重载,编译直接报错,存 ...