Linked Questions

Popular Questions

I have an Android application, written using Xamarin.Android but I believe the issue applies Android in general. I have the app installed on a few test devices and it was working fine at first. However, at some point the app started crashing constantly. I don't know how it got in this state but from that point forward, it happens constantly. Because it is already installed, all I could do was use LogCat to look at the error. I cannot use the Visual Studio debugger because it essentially re-installs the app and the error does not happen. I have been trying for a while with the app in debug mode to get it to go back in this state but I have been unsuccessful so far.

I feel like I need the debugger to give me a bit more information to figure this out. I am pretty sure, based on the errors below that the issue is the bottom navigation is null and that is why it cannot set the text. However, I am not sure how the bottom navigation can be null, how we get in this state and why a restart does not fix it, only a re-install does.

Here is the error I see in LogCat:

LogCat Error

Here is the axml where I have the bottom navigation view and where it sets the text color:

<android.support.design.widget.BottomNavigationView
        android:id="@+id/bottom_nav"
        android:layout_width="match_parent"
        android:layout_height="70dp"
        android:layout_gravity="start"
        android:layout_alignParentBottom="true"
        app:elevation="16dp"
        android:background="@color/backgroundNormal"
        app:itemIconTint="@color/lightText"
        app:itemTextColor="@color/lightText"
        app:menu="@menu/bottom_navigation" />

And this is the bottom_navigation xml from the menu folder:

<menu xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto">

   <!--Update strings and icons-->
   <item android:id="@+id/menu_batches"
      android:title="Batches"
      android:icon="@drawable/ic_action_arrow_back"
      app:showAsAction="ifRoom"/>

   <item android:id="@+id/menu_options"
     android:title="Options"
     android:icon="@drawable/ic_action_options"
     app:showAsAction="ifRoom"/>

   <item android:id="@+id/menu_home"
     android:title="Home"
     android:icon="@drawable/ic_action_home"
     app:showAsAction="ifRoom"/>

   <item android:id="@+id/menu_settings"
     android:title="Settings"
     android:icon="@drawable/ic_action_settings"
     app:showAsAction="ifRoom"/>

   <item android:id="@+id/menu_post"
     android:title="Post"
     android:icon="@drawable/ic_action_arrow_forward"
     app:showAsAction="ifRoom"/>

</menu>

Any ideas on how I can debug or troubleshoot this further or does anybody have a better idea from the LogCat log on what might be happening and how I can fix it?

Thanks!

Related Questions