android.view.InflateException:二进制XML文件行#0:二进制XML文件行#0:错误膨胀类com.quentindommerc.superlistview.SuperListvie

时间:2017-11-10 19:01:48

标签: android xml android-fragments layout-inflater

我使用了更多解决方案来解决这个问题,但是当我执行应用程序而不是应用程序崩溃时我找不到解决这个问题的解决方案并且在更新android studio之前发现上述异常它的工作正常但是当我更新android studio 3.0时app崩溃了......请帮帮我。

XML

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#fff"
    tools:context="com.tecorb.wingbemerchant.Fragments.TransportFragments.TodayFragment">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <include layout="@layout/sort_filter_layout" />


        <com.quentindommerc.superlistview.SuperListview xmlns:superlistview="http://schemas.android.com/apk/res-auto"
            android:id="@+id/list_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            superlistview:superlv__empty="@layout/empty_view_layout"
            superlistview:superlv__listClipToPadding="false"
            superlistview:superlv__listDivider="@android:color/transparent"
            superlistview:superlv__scrollbarStyle="outsideOverlay"/>

    </LinearLayout>


    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="10dp"
        android:src="@drawable/marker"
        app:backgroundTint="@color/black" />

</FrameLayout>

布局在这里充气

@Override
    public void onAttach(Context context) {
        super.onAttach(context);
        this.context = context;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_today, container, false);
    }

错误

FATAL EXCEPTION: 
                              android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class com.quentindommerc.superlistview.SuperListview
                                                   Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class com.quentindommerc.superlistview.SuperListview
                                                   Caused by: java.lang.reflect.InvocationTargetException
                                                       at java.lang.reflect.Constructor.newInstance0(Native Method)
                                                       at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
                                                       at android.view.LayoutInflater.createView(LayoutInflater.java:652)
                                                       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:812)
                                                       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:752)
                                                       at android.view.LayoutInflater.rInflate(LayoutInflater.java:883)
                                                       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:846)
                                                       at android.view.LayoutInflater.rInflate(LayoutInflater.java:886)
                                                       at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:846)
                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:522)
                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:430)
                                                       at com.tecorb.wingbemerchant.Fragments.TransportFragments.TodayFragment.onCreateView(TodayFragment.java:108)
                                                       at android.support.v4.app.Fragment.performCreateView(Fragment.java:2192)
                                                       at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1299)
                                                       at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
                                                       at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
                                                       at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:758)
                                                       at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2363)
                                                       at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2149)
                                                       at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2103)
                                                       at android.support.v4.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:1984)
                                                       at android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:626)
                                                       at android.support.v4.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:166)
                                                       at android.support.v4.view.ViewPager.populate(ViewPager.java:1268)
                                                       at android.support.v4.view.ViewPager.populate(ViewPager.java:1116)
                                                       at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1642)
                                                       at android.view.View.measure(View.java:19759)
                                                       at android.widget.LinearLayout.measureVertical(LinearLayout.java:911)
                                                       at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
                                                       at android.view.View.measure(View.java:19759)
                                                       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6122)
                                                       at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
                                                       at android.view.View.measure(View.java:19759)
                                                       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6122)
                                                       at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
                                                       at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
                                                       at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
                                                       at android.view.View.measure(View.java:19759)
                                                       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6122)
                                                       at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
                                                       at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139)
                                                       at android.view.View.measure(View.java:19759)
                                                       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6122)
                                                       at android.support.v7.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:393)
                                                       at android.view.View.measure(View.java:19759)
                                                       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6122)
                                                       at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
                                                       at android.view.View.measure(View.java:19759)
                                                       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6122)
11-11 00:17:54.718 17196-17196/? E/AndroidRuntime:     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
                                                       at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
                                                       at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
                                                       at android.view.View.measure(View.java:19759)
                                                       at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6122)
                                                       at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
                                                       at com.android.internal.policy.DecorView.onMeasure(DecorView.java:690)
                                                       at android.view.View.measure(View.java:19759)
                                                       at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2313)
                                                       at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1400)
                                                       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1649)
                                                       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1288)
                                                       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6359)
                                                       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:873)
                                                       at android.view.Choreographer.doCallbacks(Choreographer.java:685)
                                                       at android.view.Choreographer.doFrame(Choreographer.java:621)
                                                       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:859)
                                                       at android.os.Handler.handleCallback(Handler.java:754)
                                                       at android.os.Handler.dispatchMessage(Handler.java:95)
                                                       at android.os.Looper.loop(Looper.java:163)
                                                       at android.app.ActivityThread.main(ActivityThread.java:6237)
                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
                                                    Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x106000d type #0x1c is not valid
                                                       at android.content.res.Resources.loadXmlResourceParser(Resources.java:2128)
                                                       at android.content.res.Resources.getLayout(Resources.java:1129)
                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:428)
                                                       at android.view.ViewStub.inflate(ViewStub.java:259)
                                                       at com.quentindommerc.superlistview.BaseSuperAbsListview.initView(BaseSuperAbsListview.java:113)
                                                       at com.quentindommerc.superlistview.BaseSuperAbsListview.<init>(BaseSuperAbsListview.java:66)
                                                       at com.quentindommerc.superlistview.SuperListview.<init>(SuperListview.java:26)

1 个答案:

答案 0 :(得分:0)

这里的问题......

android.view.InflateException:二进制XML文件行#0:二进制XML文件行#0:错误膨胀类android.support.v7.internal.widget.ActionBarOverlayLayout

升级到android studio 3.0的代码