android.view.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class


看了很久都没发现错误。

后来用复现项目不断复制二分确定范围,发现出现这个错误的原因是xml文件里的问题,因为是xml文件的错误,而不是class里面,所以代码一直没报错。

这里有黄底色的提示,表示没有这个SquareLayout的引用,所以程序在引用这个版式的时候就崩溃了,其实是我在复现项目的时候没有复制过去。
加上相应的文件即可。

package com.example.artshoes2;import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;public class SquareLayout extends RelativeLayout {public SquareLayout(Context context, AttributeSet attrs, int defStyle) {super(context, attrs, defStyle);}public SquareLayout(Context context, AttributeSet attrs) {super(context, attrs);}public SquareLayout(Context context) {super(context);}@SuppressWarnings("unused")@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {super.onMeasure(widthMeasureSpec, widthMeasureSpec);}
}

之后就能正常运行了。

android.view.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating相关推荐

  1. Android运行时候报错:android.view.InflateException: Binary XML file line #19: Binary XML file lin

    Android运行时候报错:android.view.InflateException: Binary XML file line #19: Binary XML file lin 这个问题自己大致在 ...

  2. android.view.InflateException: Binary XML file line #7: Binary XML file line #7

    错误如下 11-21 08:19:44.040 3608-3608/com.leon.oldrecyclerview E/AndroidRuntime: FATAL EXCEPTION: main   ...

  3. 报错android.view.InflateException: Binary XML file line #11: Attempt to invoke virtual method 'boolean

    出现这种问题,打开Android monitor的调试信息发现是 android.view.InflateException: Binary XML file line #11: Attempt to ...

  4. Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class lzl.edu.c

    在自定义view中常常会出现这么一个错误 Caused by: android.view.InflateException: Binary XML file line #12: Error infla ...

  5. Android stuido 解决Caused by: android.view.InflateException: Binary XML file line #8: Binary XML file

    Android stuido 解决Caused by: android.view.InflateException: Binary XML file line #8: Binary XML file ...

  6. android.view.inflateexception binary xml file line 异常的解决方法

    有时候一个很简单的xml布局文件,运行却抛出以下异常: 07-25 10:40:50.966: D/AndroidRuntime(31570): Shutting down VM 07-25 10:4 ...

  7. 运行安卓程序报错android.view.InflateException: Binary XML file line #11: Error inflating class ImageView

    运行安卓程序报错android.view.InflateException: Binary XML file line #11: Error inflating class ImageView 先上代 ...

  8. Android编程:解决异常“android.view.InflateException: Binary XML file line # : Error inflating class”

    我一般都是在1和4 遇到,记录一下. 今天写程序发现一个问题,就是XML中报出Android.view.InflateException异常,可能的原因有: 1.XML中使用到得组件名称是否书写正确( ...

  9. android.view.InflateException: Binary XML file 解决方

    2019独角兽企业重金招聘Python工程师标准>>> java.lang.RuntimeException: Unable to start activity ComponentI ...

最新文章

  1. C++_泛型编程与标准库(七)
  2. python walk 遍历文件夹 文件大小
  3. C语言经典例5-输入三个数由小到大输出
  4. Numpy中array和matrix转换
  5. Makefile中的patsubst函数
  6. linux日常管理3
  7. 一位资深程序员的成长故事
  8. [Hnoi2006]马步距离
  9. 面向对象方法及软件工程——团队答辩
  10. 微软账号 被阻止登录会自动解锁码_WPS Office 13.2.0 国际解锁高级版 清爽无广告...
  11. jquery 动态添加,降低input表单的方法
  12. 使用打印方法将caj、pdz转pdf格式
  13. 头像制作软件有哪些?2022微信头像制作软件推荐
  14. 分页查询PageHelper.startPage()无法实现分页
  15. VMware虚拟机丨VMware11虚拟机软件下载+安装教程
  16. 最先进的Git分布式仓库系统——是如何提升编程效率的?
  17. 用c++写一个简单的钓鱼(集卡)程序
  18. 如何去除Mac截图的窗口阴影
  19. android开发包下载
  20. 从微软官网下载原版Windows10

热门文章

  1. 【BDTC 2016】大数据云服务论坛:云上的大数据探索
  2. Mybatis | Mybatis-plus配置多数据源,连接多数据库
  3. 人机大战,历史的见证
  4. 北京汽车摩托车年检查询指南(工作时间、最近检测厂、联系电话)
  5. 关于云计算资源调度的一些思考
  6. python 日期大小比较
  7. 2018年,中国空气质量在全球的排名,你一定想不到!
  8. Codeforces Round #470 (Div. 2) A Protect Sheep (基础)输入输出的警示、边界处理
  9. 徘徊于千八关口未能如愿?黄金是涨是跌?走势分析策略指导
  10. C:1094统计元音(函数专题)