0

I realize that there are a lot of questions with titles similar to this one, but I think my problem is one that has not yet been addressed.

I have an existing Android application that is entering the intensive beta-testing phase. To that end, I am attempting to implement Instabug to help out.

This morning, before attempting to implement Instabug, my app worked (in that it launched).

My MainActivity extends android.app.Activity, so I replaced that with InstabugActivity (com.instabug.wrapper.support.activity.InstabugActivity).

My MainActivity is for login/sign up, and then the app transitions to an AppRootActivity, which is an android.support.v7.app.ActionBarActivity. This is because the app has a navigation drawer. So, I changed AppRootActivity to an InstabugActionBarActivity (com.instabug.wrapper.support.activity.InstabugActionBarActivity).

When I run the app in debug mode using an attached device, it works just fine. When I push the app out to my testers via Fabric/Crashlytics, the app crashes at launch.

From what I can tell, these are the important error messages I'm getting:

java.lang.RuntimeException: 
Unable to start activity ComponentInfo{com.company.app/com.company.app.MainActivity}:
      android.view.InflateException: Binary XML file line #14:
      Error inflating class fragment

Caused by: 
      android.view.InflateException: Binary XML file line #14: 
      Error inflating class fragment
  at com.company.app.MainActivity.onCreate(Unknown Source)

Caused by: 
      android.app.Fragment$InstantiationException: 
      Trying to instantiate a class 
      com.company.app.NavigationDrawerFragment 
      that is not a Fragment
      at com.company.app.MainActivity.onCreate(Unknown Source)

Caused by: java.lang.ClassCastException
  at com.company.app.MainActivity.onCreate(Unknown Source)

Ok, now here's the weird thing. MainActivity is never tied to NavigationDrawerFragment. Never.

I have no idea why the app is trying to instantiate NavigationDrawerFragment when the app is launching.

Even still, though, NavigationDrawerFragment extends MyFragment which extends Fragment (android.support.v4.app.Fragment).

I am really, really lost here. I'd love to use Instabug, because their product on iOS is really nice and impressive, but I can't figure this out!


Edit

Here's the XML layout for ActivityMain:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="@drawable/main_activity_background"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:orientation="vertical"

    >

    <View
        android:layout_height="0dp"
        android:layout_weight="1"
        android:layout_width="match_parent"


        />

    <ImageView
        android:gravity="center"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_width="wrap_content"
        android:src="@drawable/main_activity_logo"

        />

    <View
        android:layout_height="0dp"
        android:layout_weight="1"
        android:layout_width="match_parent"

        />

    <TextView
        android:id="@+id/main_activity_tag_line_text_view"
        android:gravity="center"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_width="wrap_content"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:text="@string/tag_line"
        android:textColor="@color/off_white"
        android:textSize="20dp"

        />

    <ImageButton
        android:id="@+id/main_activity_sign_up_with_Facebook_button"
        android:background="@drawable/main_activity_facebook_button_shape"
        android:layout_gravity="center"
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/main_activity_vertical_button_margin"
        android:layout_marginTop="@dimen/main_activity_vertical_button_margin"
        android:layout_width="wrap_content"
        android:paddingBottom="@dimen/main_activity_facebook_sign_up_button_vertical_padding"
        android:paddingLeft="@dimen/main_activity_facebook_sign_up_button_horizontal_padding"
        android:paddingRight="@dimen/main_activity_facebook_sign_up_button_horizontal_padding"
        android:paddingTop="@dimen/main_activity_facebook_sign_up_button_vertical_padding"
        android:src="@drawable/main_activity_facebook_sign_up"

        />

    <Button
        android:id="@+id/main_activity_sign_up_button"
        android:background="@drawable/sign_up_button_shape"
        android:gravity="center"
        android:layout_gravity="center"
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/main_activity_vertical_button_margin"
        android:layout_marginTop="@dimen/main_activity_vertical_button_margin"
        android:layout_width="wrap_content"
        android:text="@string/sign_up_title"
        android:textColor="@color/dark_gray"
        android:textSize="@dimen/login_button_text_size"

        />

    <Button
        android:id="@+id/main_activity_login_button"
        android:background="@drawable/main_activity_login_button_shape"
        android:gravity="center"
        android:layout_gravity="center"
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/main_activity_vertical_button_margin"
        android:layout_marginTop="@dimen/main_activity_vertical_button_margin"
        android:layout_width="wrap_content"
        android:text="@string/login_title"
        android:textColor="@color/gold"
        android:textSize="@dimen/login_button_text_size"

        />

    <TextView
        android:id="@+id/main_activity_disclaimer_text_view"
        android:gravity="center"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginBottom="4dp"
        android:layout_marginTop="4dp"
        android:layout_width="wrap_content"
        android:text="@string/disclaimer"
        android:textColor="@color/off_white"
        android:textSize="12dp"

        />

</LinearLayout>
mbm29414
  • 11,558
  • 6
  • 56
  • 87
  • can you try extending `InstabugAppCompatActivity` instead of `InstabugActionBarActivity` ? – Blackbelt Sep 28 '15 at 14:41
  • @Blackbelt Sure, but why is the app even getting that far? The `InstabugActionBarActivity` shouldn't even be **loaded** yet! I'll give this a try, but do you know why it's preloading the other activity? – mbm29414 Sep 28 '15 at 14:42
  • Could you post main activity layout file? – wasyl Sep 28 '15 at 15:17

0 Answers0