【发布时间】:2017-11-30 08:22:42
【问题描述】:
我正在使用ExpandableLayout 库,它工作得很好,但是在升级到 gradle 3.0 后,我遇到了这个错误:
android.view.InflateException: Binary XML file line #2: Error inflating class com.andexert.expandablelayout.library.ExpandableLayoutItem
...
Caused by: java.lang.reflect.InvocationTargetException
...
Caused by: java.lang.IllegalArgumentException: Header
上线:
View root = inflater.inflate(R.layout.item, null);
还有我的item.xml:
<?xml version="1.0" encoding="utf-8"?>
<com.andexert.expandablelayout.library.ExpandableLayoutItem
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/expandableLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:headerLayout="@layout/header"
app:contentLayout="@layout/content"/>
【问题讨论】:
-
你在你的 gradle 依赖中添加了
compile com.github.traex.expandablelayout:library:1.3吗? -
在你的堆栈跟踪中查看
Caused by: -
Caused by: java.lang.reflect.InvocationTargetException和Caused by: java.lang.IllegalArgumentException: Header -
那么 full 堆栈跟踪是什么?将其添加到您的问题中
-
@Anas,从 3.0 升级到 3.0.1 后,我遇到了和你一样的问题,我所有的包都没有解决,但有趣的是 gradle 正在构建没有错误。这似乎是一个错误
标签: android android-studio exception