-1

I get this error in debugger when trying to open my app on a phone with marshmallow API 23, I installed this app fine on my s10 and can play flawlessly but on my s6 there should be no problems either but it doesn't seem to get passed the splash screen or open without crashing almost immediate. I know how to build an APK and install it correctly but the problem lies with the code provided. anyone with some decent understanding of this error if you are able to lend a hand it would be greatly appreciated.

I came across a thread that talked about drawable image resolution compared to game resolution but I do not know how much that is related.

Error codes from my code

1) *com.example.finalprojectdkjw.StartActivity.onCreate(StartActivity.java:69)*
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);

 2) *com.example.finalprojectdkjw.StartFragment.onCreateView(StartFragment.java:18)*
   public class StartFragment extends Fragment {

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

}

Full error code message

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.finalprojectdkjw, PID: 6640 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.finalprojectdkjw/com.example.finalprojectdkjw.StartActivity}: android.view.InflateException: Binary XML file line #9: Binary XML file line #9: Error inflating class at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) at android.app.ActivityThread.-wrap11(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: android.view.InflateException: Binary XML file line #9: Binary XML file line #9: Error inflating class at android.view.LayoutInflater.inflate(LayoutInflater.java:539) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at android.view.LayoutInflater.inflate(LayoutInflater.java:374) at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at com.example.finalprojectdkjw.StartActivity.onCreate(StartActivity.java:69) at android.app.Activity.performCreate(Activity.java:6237) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)  at android.app.ActivityThread.-wrap11(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5417)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)  Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class at android.view.LayoutInflater.createView(LayoutInflater.java:645) at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:694) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:762) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:423)  at android.view.LayoutInflater.inflate(LayoutInflater.java:374)  at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)  at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)  at com.example.finalprojectdkjw.StartActivity.onCreate(StartActivity.java:69)  at android.app.Activity.performCreate(Activity.java:6237)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)  at android.app.ActivityThread.-wrap11(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5417)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)  Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance(Native Method) at android.view.LayoutInflater.createView(LayoutInflater.java:619) at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:694)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:762)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)  at android.view.LayoutInflater.inflate(LayoutInflater.java:515)  at android.view.LayoutInflater.inflate(LayoutInflater.java:423)  at android.view.LayoutInflater.inflate(LayoutInflater.java:374)  at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)  at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)  at com.example.finalprojectdkjw.StartActivity.onCreate(StartActivity.java:69)  at android.app.Activity.performCreate(Activity.java:6237)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)  at android.app.ActivityThread.-wrap11(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5417)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)  Caused by: android.content.res.Resources$NotFoundException: Resource "com.example.finalprojectdkjw:drawable/startmenuimg" (7f06009b) is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f06009b a=-1 r=0x7f06009b} at android.content.res.Resources.loadDrawableForCookie(Resources.java:2602) at android.content.res.Resources.loadDrawable(Resources.java:2540) at android.content.res.TypedArray.getDrawable(TypedArray.java:870) at android.view.View.(View.java:3948) at android.view.ViewGroup.(ViewGroup.java:573) at android.widget.LinearLayout.(LinearLayout.java:203) at android.widget.LinearLayout.(LinearLayout.java:199) at android.widget.LinearLayout.(LinearLayout.java:195) at java.lang.reflect.Constructor.newInstance(Native Method)  at android.view.LayoutInflater.createView(LayoutInflater.java:619)  at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:694)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:762)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)  at android.view.LayoutInflater.inflate(LayoutInflater.java:515)  at android.view.LayoutInflater.inflate(LayoutInflater.java:423)  at android.view.LayoutInflater.inflate(LayoutInflater.java:374)  at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)  at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)  at com.example.finalprojectdkjw.StartActivity.onCreate(StartActivity.java:69)  at android.app.Activity.performCreate(Activity.java:6237)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)  at android.app.ActivityThread.-wrap11(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:148)  at android.app.ActivityThread.main(ActivityThread.java:5417)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

XML (ACTIVTY_START)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="vertical"
    tools:context="com.example.finalprojectdkjw.StartActivity">

    <fragment android:name="com.example.finalprojectdkjw.StartFragment"
        android:id="@+id/startFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </fragment>

</LinearLayout>

XML (FRAGMENT_START)

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

    <!-- TODO: Update blank fragment layout -->
    <LinearLayout
        android:id="@+id/mainMenu"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:background="@drawable/startmenuimg"
        android:visibility="visible">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:layout_marginTop="10dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_gravity="center">
                <TextView
                    android:layout_width="300dp"
                    android:layout_height="100dp"
                    android:background="@drawable/title"/>
            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="130dp"
                android:orientation="horizontal"
                android:layout_gravity="center">
                <ImageView
                    android:layout_width="100dp"
                    android:layout_height="100dp"
                    android:layout_marginBottom="60dp"
                    android:src="@drawable/packyak" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_gravity="center">
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/instruction1"
                    android:textSize="32sp"
                    android:textStyle="bold"/>
            </LinearLayout>
            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_gravity="center">
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/instruction2"
                    android:textSize="32sp"
                    android:textStyle="bold"/>
            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_gravity="center">
                <TableLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="20dp">

                    <TableRow android:gravity="center_vertical">

                        <ImageView
                            android:layout_width="40dp"
                            android:layout_height="40dp"
                            android:src="@drawable/grassclean" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:paddingLeft="10dp"
                            android:text="@string/cleanGrassRule"
                            android:textSize="22sp"
                            android:textStyle="bold"/>
                    </TableRow>

                    <TableRow
                        android:layout_marginTop="20dp"
                        android:gravity="center_vertical">

                        <ImageView
                            android:layout_width="40dp"
                            android:layout_height="40dp"
                            android:src="@drawable/grassdirty" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:paddingLeft="10dp"
                            android:text="@string/dirtyGrassRule"
                            android:textSize="22sp"
                            android:textStyle="bold" />
                    </TableRow>

                    <TableRow android:gravity="center_vertical">

                        <ImageView
                            android:layout_width="55dp"
                            android:layout_height="55dp"
                            android:src="@drawable/glowarrowcropped" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:paddingLeft="10dp"
                            android:text="@string/gameOverRule"
                            android:textSize="22sp"
                            android:textStyle="bold"/>
                    </TableRow>

                </TableLayout>
            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:layout_gravity="center"
                android:layout_marginBottom="5dp">

                <Button
                    android:id="@+id/btnStartGame"
                    android:layout_width="100dp"
                    android:layout_height="40dp"
                    android:layout_gravity="center"
                    android:background="@drawable/startimg" />

                <Button
                    android:id="@+id/btnScoreboard"
                    android:layout_width="195dp"
                    android:layout_height="25dp"
                    android:layout_gravity="center"
                    android:layout_marginTop="15dp"
                    android:layout_marginBottom="5dp"
                    android:background="@drawable/high_score" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_gravity="center">
                <Button
                    android:id="@+id/mutebutton"
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:background="@drawable/playt"/>
                <!--        android:onClick="play" />-->
                <!--    <Button-->
                <!--        android:layout_width="wrap_content"-->
                <!--        android:layout_height="wrap_content"-->
                <!--        android:text="pause"-->
                <!--        android:onClick="pause"/>-->
                <!--    <Button-->
                <!--        android:layout_width="wrap_content"-->
                <!--        android:layout_height="wrap_content"-->
                <!--        android:text="Mute"-->
                <!--        android:onClick="stop"/>-->
            </LinearLayout>

        </LinearLayout>

    </LinearLayout>

    <LinearLayout
        android:id="@+id/highScoreMenu"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:background="@drawable/scrollimg"
        android:visibility="gone">

        <ImageView
            android:layout_width="350dp"
            android:layout_height="100dp"
            android:src="@drawable/high_score"
            android:layout_gravity="center"
            android:layout_marginTop="30dp"/>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_gravity="center">

            <Button
                android:id="@+id/btnScoreEasy"
                android:layout_width="110dp"
                android:layout_height="40dp"
                android:background="@drawable/easyscores"
                android:layout_marginEnd="20dp"/>

            <Button
                android:id="@+id/btnScoreHard"
                android:layout_width="110dp"
                android:layout_height="40dp"
                android:layout_marginStart="20dp"
                android:background="@drawable/hardscores"/>

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:weightSum="5">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Place"
                android:textStyle="bold"
                android:textSize="30sp"
                android:textAlignment="textStart"
                android:paddingStart="30dp"
                android:layout_marginStart="20dp"
                android:textColor="@color/scoreColor"
                android:layout_weight="1"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Name"
                android:textStyle="bold"
                android:textSize="30sp"
                android:textAlignment="center"
                android:textColor="@color/scoreColor"
                android:layout_weight="4"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Score"
                android:textStyle="bold"
                android:textSize="30sp"
                android:textAlignment="textEnd"
                android:paddingEnd="30dp"
                android:layout_marginEnd="20dp"
                android:textColor="@color/scoreColor"
                android:layout_weight="1"/>

        </LinearLayout>

        <!--Easy mode-->
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/easyScoreboardRecyclerView"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="10"
            android:visibility="gone">
        </androidx.recyclerview.widget.RecyclerView>

        <!--Hard mode-->
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/hardScoreboardRecyclerView"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="10"
            android:visibility="visible">
        </androidx.recyclerview.widget.RecyclerView>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:layout_marginBottom="50dp"
            android:orientation="vertical">

            <Button
                android:id="@+id/btnTryAgain"
                android:layout_width="120dp"
                android:layout_height="40dp"
                android:layout_marginTop="10dp"
                android:layout_marginBottom="10dp"
                android:background="@drawable/retryimg"
                android:visibility="visible"/>

            <Button
                android:id="@+id/btnHomeScreen"
                android:layout_width="100dp"
                android:layout_height="35dp"
                android:background="@drawable/homeimg"/>

        </LinearLayout>

    </LinearLayout>

    <LinearLayout
        android:id="@+id/difficultyMenu"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:background="@drawable/scrollimg"
        android:weightSum="10"
        android:visibility="gone">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_weight="6">

            <Button
                android:id="@+id/btnReturn"
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:background="@drawable/btn_return"
                android:layout_gravity="start"/>

            <ImageView
                android:layout_width="300dp"
                android:layout_height="100dp"
                android:src="@drawable/difficulty"
                android:layout_gravity="center"/>

        </LinearLayout>


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:layout_marginBottom="50dp">

            <Button
                android:id="@+id/btnEasy"
                android:layout_width="150dp"
                android:layout_height="200dp"
                android:layout_margin="5dp"
                android:background="@drawable/easy"/>

            <Button
                android:id="@+id/btnHard"
                android:layout_width="150dp"
                android:layout_height="200dp"
                android:layout_margin="5dp"
                android:background="@drawable/hard"/>


        </LinearLayout>

    </LinearLayout>

</FrameLayout>
  • 1
    There's an issue with `StartFragment`'s layout. – Mike M. Nov 30 '19 at 16:55
  • could u post the xml? – Rahul Agrawal Nov 30 '19 at 17:28
  • Posted XML for both activity and fragment_start. – BeenThereDoneThat Nov 30 '19 at 17:37
  • It's having a problem inflating the `mainMenu` `LinearLayout`. Is there any more to that stack trace? It's cut off before the final cause. If there's not, the quickest way to get that would be to temporarily use that `Fragment` layout in the `Activity`'s `setContentView()` call. You should see the whole stack trace, then, since it won't have all of the `Fragment` stuff in it. – Mike M. Nov 30 '19 at 17:41
  • I think i updated it to show the whole stack trace, if not i did not follow what you said properly and i am sorry for that. – BeenThereDoneThat Nov 30 '19 at 17:55
  • Still the same truncated trace. I meant, temporarily change `setContentView(R.layout.activity_start)` in `StartActivity` to `setContentView(R.layout.fragment_start)`. It'll crash sooner, and you should be able to get the important `Caused by` line at the end. – Mike M. Nov 30 '19 at 18:03
  • just updated the stack trace correctly doing what you said. – BeenThereDoneThat Nov 30 '19 at 18:07
  • 1
    Bingo: `Resources$NotFoundException: Resource "com.example.finalprojectdkjw:drawable/startmenuimg" (7f06009b) is not a Drawable (color or path)`. Which Android version are you testing on? Do you possibly have the `startmenuimg` drawable only in a `res/drawable-v??/` folder for a newer version? – Mike M. Nov 30 '19 at 18:10
  • they are all v24 – BeenThereDoneThat Nov 30 '19 at 18:12
  • That's your problem. You're crashing on 23 because that drawable (at least that one) is only available for 24 and above. – Mike M. Nov 30 '19 at 18:13
  • How do i set image versions? – BeenThereDoneThat Nov 30 '19 at 18:14
  • 2
    You put them in the relevant folders. For example, the `res/drawable*/` folders without a `v??` modifier will be for all other versions before 24. Make sure you have images with those IDs available for all versions you support. – Mike M. Nov 30 '19 at 18:17
  • i must of just been tossing in images without knowing the differences. ill sort and report back. – BeenThereDoneThat Nov 30 '19 at 18:19
  • @MikeM. You have solved the problem. it now works on those devices. i will now try to figure out how i would make the screen fit properly on the older devices. it seems off. Appreciate it. i should should design xml files for each and every device with all different screen sizes? – BeenThereDoneThat Nov 30 '19 at 18:24
  • Nah, you definitely don't need to do it for every possible size. However, depending on your layouts, and which devices you support, you might have to have different ones for small versus large, phone versus tablet, etc. It really depends on how you set them up. Try to stay away from absolute locations and sizes for your `View`s, and it's easier to adapt them. You'll just have to test the different configurations, to see how they work out. – Mike M. Nov 30 '19 at 18:32

1 Answers1

1

Change

<fragment android:name="com.example.finalprojectdkjw.StartFragment"

to

<fragment class="com.example.finalprojectdkjw.StartFragment"

Although android:name and class attribute are considered interchangeable but for some reason android:name doesn't work for some devices.

EDIT

There could be multiple reasons for this error to occur. If the above solution doesn't work try enclosing the whole body of your fragment's onCreatView() inside a try catch block and log the exception error as shown below. It will give you more reasonable error message.

public View onCreateView(LayoutInflater inflater, ViewGroup contnr, Bundle savedInstSt) {
    try {
       // ...
       return inflater.inflate(R.layout.fragment_start, container, false);

    } catch (Exception e) {
        Log.e(TAG, "onCreateView", e);
        throw e;
    }
}
Syed Ahmed Jamil
  • 1,881
  • 3
  • 18
  • 34