1

The app crashes immediately after startup, with the error:

11-08 21:13:08.704 15973-15973/com.t99sdevelopment.centralized E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.t99sdevelopment.centralized/com.t99sdevelopment.centralized.HomeScreen}: android.view.InflateException: Binary XML file line #81: Error inflating class android.support.design.widget.NavigationView

The java file:

package com.t99sdevelopment.centralized;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Window;
import android.widget.Toolbar;



public class HomeScreen extends AppCompatActivity {



   Intent intentHome = new Intent(this, HomeScreen.class);
   Intent intentAnnouncements = new Intent(this, AnnouncementsScreen.class);
   /*
   Intent intentSchedule = new Intent(this, ScheduleScreen.class);
   Intent intentCalendar = new Intent(this, CalendarScreen.class);
   Intent intentContactBook = new Intent(this, ContactBookScreen.class);
   Intent intentSportsSchedule = new Intent(this, SportsScheduleScreen.class);
   Intent intentFrontAndCentral = new Intent(this, FrontAndCentralScreen.class);
   Intent intentMap = new Intent(this, MapScreen.class);
   Intent intentAccount = new Intent(this, AccountScreen.class);
   */



   @Override
   protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_homescreen);
       setTheme(R.style.AppTheme);
   }



   private void goToHome(){



   }
   private void goToAnnouncements(){
       startActivity(intentAnnouncements);
   }



   private void goToSchedule(){



   }



   private void goToCalendar(){



   }



   private void goToContactBook(){



   }



   private void goToSportsSchedule(){



   }



   private void goToFrontAndCentral(){



   }



   private void goToMap(){



   }



   private void goToAccount(){



   }
}

Here's the gist of the other files.

This error indicates that the nav drawer couldn't be created, but between the last time the nav drawer was working, and now, I haven't changed anything that would seem to affect it.

I reviewed the code, changed a couple things, the error remained the same, but the code was different, so I submitted a different, new page here, which was solved.

Community
  • 1
  • 1
Trevor Sears
  • 459
  • 8
  • 24

2 Answers2

0

If you really did nothing try to clear and build project or copy the code into new prpject

Angen
  • 400
  • 2
  • 10
0

There is an issue with version 23.1.0 of the design library and Proguard. As a workaround you should add

-keep class android.support.v7.widget.LinearLayoutManager { *; } 

to your proguard-rules.pro.

Have a look at this issue: NavigationView InflateException

Antict
  • 597
  • 5
  • 22