2012-06-28 39 views
-1

我已經在這個項目上工作了幾個星期了,突然之間我得到了這個java.lang.NullPointerException。它編譯得很好。但是當我運行它時,我收到了這個錯誤。
因此,我改變了工作空間,並加載了我的項目的一個以前的工作版本,我一直把它作爲備份。還有同樣的問題。這款應用程序加載,即使第一個佈局之前崩潰......我的android項目變得「java.lang.NullPointerException」

這裏是我的logcat:

06-28 20:04:46.428: D/AndroidRuntime(382): Shutting down VM 
06-28 20:04:46.428: W/dalvikvm(382): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 
06-28 20:04:46.542: E/AndroidRuntime(382): FATAL EXCEPTION: main 
06-28 20:04:46.542: E/AndroidRuntime(382): java.lang.RuntimeException: Unable to start activity ComponentInfo{cloud.mobile/cloud.mobile.MCActivity}: java.lang.NullPointerException 
06-28 20:04:46.542: E/AndroidRuntime(382): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) 
06-28 20:04:46.542: E/AndroidRuntime(382): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 
06-28 20:04:46.542: E/AndroidRuntime(382): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 
06-28 20:04:46.542: E/AndroidRuntime(382): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 
06-28 20:04:46.542: E/AndroidRuntime(382): at android.os.Handler.dispatchMessage(Handler.java:99) 
06-28 20:04:46.542: E/AndroidRuntime(382): at android.os.Looper.loop(Looper.java:123) 
06-28 20:04:46.542: E/AndroidRuntime(382): at android.app.ActivityThread.main(ActivityThread.java:4627) 
06-28 20:04:46.542: E/AndroidRuntime(382): at java.lang.reflect.Method.invokeNative(Native Method) 
06-28 20:04:46.542: E/AndroidRuntime(382): at java.lang.reflect.Method.invoke(Method.java:521) 
06-28 20:04:46.542: E/AndroidRuntime(382): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 
06-28 20:04:46.542: E/AndroidRuntime(382): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 
06-28 20:04:46.542: E/AndroidRuntime(382): at dalvik.system.NativeStart.main(Native Method) 
06-28 20:04:46.542: E/AndroidRuntime(382): Caused by: java.lang.NullPointerException 
06-28 20:04:46.542: E/AndroidRuntime(382): at cloud.mobile.MCActivity.setLoggedIn(MCActivity.java:279) 
06-28 20:04:46.542: E/AndroidRuntime(382): at cloud.mobile.MCActivity.onCreate(MCActivity.java:198) 
06-28 20:04:46.542: E/AndroidRuntime(382): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 
06-28 20:04:46.542: E/AndroidRuntime(382): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 
06-28 20:04:46.542: E/AndroidRuntime(382): ... 11 more 

P.S,今天早些時候,我有一些字符串數組,並在其中動態存儲播放。這是我第一次收到此錯誤..

+2

清理您的版本,重新編譯您的應用程序並重試 – GETah

+3

嘗試先調試它。該錯誤清楚地發生在cloud.mobile.MCActivity.setLoggedIn(MCActivity.java:279) – ekholm

回答

4

沒有代碼是很難說是怎麼回事,但點開始將

at cloud.mobile.MCActivity.setLoggedIn(MCActivity.java:279 

檢查線路279 MCActivity。在特定的行上,您試圖對「某些空值進行操作」

相關問題