2015-11-09 177 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

該應用程序仍然崩潰與相同的錯誤... –