New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Caused by: android.view.InflateException: Binary XML file line #24: Error inflating class LinearLayout 异常 #8
Comments
看报错是应该是inflate xml时出现的错误,你可以贴一下你的xml,好像是LinearLayout有问题 |
就一个简单的TextView 配置了下鸿神的AutoLayout, 这个异常没有了,又出现新问题,项目能跑,但是TextView 不显示
然而,去掉@nullable,这样:
出现新异常:这个@nullable是必须的吗?
|
关于这个问题我又去看了下butterKnife的自动生成的源码
|
恩,是这样的,怎么找不到呢?直接继承 |
你是不是改initView方法的时候改错了,id没错的话,可能是,你activity,setConentView的layout和你的声明这个id的Layout不是同一个 |
不是,我就这一个布局文件,返回View和id都不行,原因还是没找到 |
神奇的好了 😄 我是这么操作的:
都没有使用 @nullable 注解,出现异常有意思一些。哈哈 黄油刀让人又爱又恨啊 |
回想整个过程: 最开始的问题,xml inflate 异常是没有配置鸿神的库,这之间我用黄油刀添加了TextView
然后配置好鸿神的库之后,如果上面代码去掉,问题就好解决了, 哈哈 谢谢了哈 👍 |
没事,解决了就好 |
我新建的Demo也出现了这个问题,初始的activity_main就一个hello world的TextView,然后继承arms的BaseActivity在混淆的环境下必崩溃 |
问题补充下,首先我不需要butterknife,所以没向楼上那样折腾,经过我反复测试,我发现崩溃的关键点是:混淆,以及3.6.1gragle插件。 |
@rexydimen 你用 AS 3.5应该就没问题,可能是 AS3.6.1 不兼容旧代码 |
@rexydimen 这个问题这里讨论,#358 |
MainActivity:
出现异常:
The text was updated successfully, but these errors were encountered: