-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. jmeter 参数化大数据取唯一值方式

    jmeter 参数化大数据取唯一值方式 一.用时间函数: 因为时间戳永远没有重复,jmeter参数化,而且要取唯一值,可以考虑用时间函数加上其他函数一起: # 以13位的时间戳作为 userID no ...

  2. F12修改html进行本地js操作页面元素

    F12修改html进行本地js操作页面元素

  3. vue---自定义指令的使用

    在vue开发项目中,指令的使用场景也是比较多的,那么该如何定义使用呢? 找到 src / directive 下新建 gender 目录,下面新建 index.js 和 gender.js index ...

  4. 虚拟机VirtualBox 共享挂载问题:mount: /mnt/xxx: wrong fs type, bad option, bad superblock on xxx

    设置好共享文件夹之后,在/mnt下面建立了一个wwwroot文件夹,然后去欢天喜地的去挂载, mount -t vboxsf www /mnt/wwwroot 结果系统提示: mount: /mnt/ ...

  5. matlab学习笔记8 基本绘图命令-特殊图形绘制

    一起来学matlab-matlab学习笔记8 基本绘图命令_3 特殊图形绘制 觉得有用的话,欢迎一起讨论相互学习~Follow Me 参考书籍 <matlab 程序设计与综合应用>张德丰等 ...

  6. 查找k8s版jenkins-slave官方镜像

    官方镜像非常多,如果查找某个单词没有找到的话,可以换一个词查找,总之各种非常的多,带maven.djk.kubectl工具的镜像,都去试试吧, 从下面查找结果中可以看到,还有centos版的jenki ...

  7. C++运行出现"what(): std::bad_alloc"的解决办法

    注:这里只是我的代码出现这种情况及对应的解决办法,你的代码不一定出现和我一样的情况.左移这篇随笔仅供参考. 运行程序出现如下结果: terminate called after throwing an ...

  8. 论文阅读:FaceBoxes: A CPU Real-time Face Detector with High Accuracy

    文章: <FaceBoxes: A CPU Real-time Face Detector with High Accuracy> Introduction 2个挑战: 1)在杂乱背景下人 ...

  9. Kubernetes 配置管理 Dashboard(十三)

    目录 一.安装配置 1.1 下载 镜像 1.2.安装 1.3.修改 NodePort 二.配置授权 Kubernetes 所有的操作我们都是通过命令行工具 kubectl 完成的.为了提供更丰富的用户 ...

  10. 【VS开发】WaitForSingleObject 和 WaitForMultipleObjects函数 (让线程挂起等待事件)

    WaitForSingleObject 和 WaitForMultipleObjects:1.WaitForSingleObject  等待函数可使线程自愿进入等待状态,直到一个特定的内核对象变为已通 ...