2015-11-09 55 views
1

该应用程序启动后立即崩溃,出现错误:崩溃的启动

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 

Java文件:

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.

此错误指示导航抽屉不能被创建,但在最后一次导航抽屉工作,现在,我没有改变任何似乎会影响它的东西。

我查看了代码,改了几件事,错误依旧,但代码不同,所以我提交了一个不同的新页面here,这个问题已经解决了。

+0

你应该发布整个堆栈跟踪。其他行也很重要 –

回答

0

如果你真的没有做任何尝试清除和建设项目或将代码复制到新prpject

0

有一个与设计库和Proguard的的23.1.0版本的问题。作为一种解决方法,您应该添加

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

到您的proguard-rules.pro。

看看这个问题:NavigationView InflateException

+0

该应用程序仍然崩溃与相同的错误... –