二进制XML文件行#38:错误导致类

时间:2017-07-31 20:34:37

标签: java android debugging

我使用2部手机进行调试,1部手机正在显示我的活动正常,另一部手机出现错误,如何修复它+如何处理它让其他用户没有崩溃?

崩溃:

07-19 19:51:33.614 18679-18679/itay.finci.org.allerwarn E/AndroidRuntime: FATAL EXCEPTION: main
                                                                      Process: itay.finci.org.allerwarn, PID: 18679
                                                                      java.lang.RuntimeException: Unable to start activity ComponentInfo{itay.finci.org.allerwarn/itay.finci.org.allerwarn.intro.IntroActivity}: android.view.InflateException: Binary XML file line #38: Error inflating class com.miz.introactivity.NextDoneButton
                                                                          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2200)
                                                                          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250)
                                                                          at android.app.ActivityThread.access$800(ActivityThread.java:139)
                                                                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1200)
                                                                          at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                          at android.os.Looper.loop(Looper.java:136)
                                                                          at android.app.ActivityThread.main(ActivityThread.java:5105)
                                                                          at java.lang.reflect.Method.invokeNative(Native Method)
                                                                          at java.lang.reflect.Method.invoke(Method.java:515)
                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
                                                                          at dalvik.system.NativeStart.main(Native Method)
                                                                       Caused by: android.view.InflateException: Binary XML file line #38: Error inflating class com.miz.introactivity.NextDoneButton

编辑: 感谢AndroidStudio反编译器,我添加了处理所有错误的done.xml。

<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="36dp"
android:height="36dp"
android:viewportHeight="48"
android:viewportWidth="48">

<group android:name="done_group">

    <path
        android:name="done"
        android:fillColor="@android:color/white"
        android:pathData="M18 32.34L9.66 24l-2.83 2.83L18 38l24-24-2.83-2.83z" />

</group>

</vector>

编辑2: 库中的布局xml:

<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v4.view.ViewPager
    android:id="@+id/view_pager"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    />

<FrameLayout
    android:layout_width="match_parent"
    android:paddingLeft="@dimen/title_padding_left"
    android:paddingStart="@dimen/title_padding_left"
    android:paddingRight="@dimen/title_padding_right"
    android:paddingEnd="@dimen/title_padding_right"
    android:layout_height="@dimen/navigation_height"
    android:layout_gravity="bottom">

    <Button
        android:id="@+id/skip_button"
        android:layout_gravity="center_vertical|left|start"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/skip"
        android:textColor="@color/skip_text_color"
        style="?attr/borderlessButtonStyle"
        />

    <LinearLayout
        android:id="@+id/progress_layout"
        android:orientation="horizontal"
        android:layout_gravity="center"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <com.miz.introactivity.NextDoneButton
        android:id="@+id/next_button"
        android:layout_width="56dp"
        android:layout_height="56dp"
        android:layout_gravity="center_vertical|right|end"
        android:background="@drawable/next_done_button_selector"
        />

</FrameLayout>

</merge>

1 个答案:

答案 0 :(得分:0)

您的IntroActivity中出现错误。 InflateException:二进制XML文件行#38:错误膨胀类com.miz.introactivity.NextDoneButton

更有可能;这可能是由于您正在使用的任何大图像,设备只是内存不足以显示它。尝试调整图像大小以使其大小更小