我正在使用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"/>
答案 0 :(得分:0)
尝试使缓存无效,因为它可能已损坏。转到文件&gt;使缓存无效/重新启动