Android 5.0.1 app停止并返回InvocationTargetException错误

时间:2014-12-11 22:56:27

标签: android garbage-collection invocationtargetexception

我已经构建了一个Android应用程序,直到更新Android API,从19到21,成功运行。现在,当我运行应用程序时,登录页面确实出现,但就在用户登录并启动MainActivity时,应用程序崩溃,说明“应用程序已停止”,同时引发错误:

12-11 17:46:21.411: E/ActivityThread(12327): Pause GC
12-11 17:46:21.411: E/ActivityThread(12327): java.lang.reflect.InvocationTargetException
12-11 17:46:21.411: E/ActivityThread(12327):    at java.lang.reflect.Method.invokeNative(Native Method)
12-11 17:46:21.411: E/ActivityThread(12327):    at java.lang.reflect.Method.invoke(Method.java:515)
12-11 17:46:21.411: E/ActivityThread(12327):    at android.app.ActivityThread.pauseGC(ActivityThread.java:5410)
12-11 17:46:21.411: E/ActivityThread(12327):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2277)
12-11 17:46:21.411: E/ActivityThread(12327):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392)
12-11 17:46:21.411: E/ActivityThread(12327):    at android.app.ActivityThread.access$900(ActivityThread.java:169)
12-11 17:46:21.411: E/ActivityThread(12327):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
12-11 17:46:21.411: E/ActivityThread(12327):    at android.os.Handler.dispatchMessage(Handler.java:102)
12-11 17:46:21.411: E/ActivityThread(12327):    at android.os.Looper.loop(Looper.java:146)
12-11 17:46:21.411: E/ActivityThread(12327):    at android.app.ActivityThread.main(ActivityThread.java:5487)
12-11 17:46:21.411: E/ActivityThread(12327):    at java.lang.reflect.Method.invokeNative(Native Method)
12-11 17:46:21.411: E/ActivityThread(12327):    at java.lang.reflect.Method.invoke(Method.java:515)
12-11 17:46:21.411: E/ActivityThread(12327):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
12-11 17:46:21.411: E/ActivityThread(12327):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
12-11 17:46:21.411: E/ActivityThread(12327):    at dalvik.system.NativeStart.main(Native Method)
12-11 17:46:21.411: E/ActivityThread(12327): Caused by: java.lang.UnsatisfiedLinkError: Native method not found: dalvik.system.VMRuntime.pauseGc:(Ljava/lang/String;)I
12-11 17:46:21.411: E/ActivityThread(12327):    at dalvik.system.VMRuntime.pauseGc(Native Method)
12-11 17:46:21.411: E/ActivityThread(12327):    ... 15 more
12-11 17:46:21.446: D/AndroidRuntime(12327): Shutting down VM
12-11 17:46:21.446: W/dalvikvm(12327): threadid=1: thread exiting with uncaught exception (group=0x41daec08)
12-11 17:46:21.451: E/AndroidRuntime(12327): FATAL EXCEPTION: main
12-11 17:46:21.451: E/AndroidRuntime(12327): Process: com.example.feastapp, PID: 12327
12-11 17:46:21.451: E/AndroidRuntime(12327): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.feastapp/com.example.feastapp.MainActivity}: java.lang.NullPointerException
12-11 17:46:21.451: E/AndroidRuntime(12327):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2334)
12-11 17:46:21.451: E/AndroidRuntime(12327):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392)
12-11 17:46:21.451: E/AndroidRuntime(12327):    at android.app.ActivityThread.access$900(ActivityThread.java:169)
12-11 17:46:21.451: E/AndroidRuntime(12327):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
12-11 17:46:21.451: E/AndroidRuntime(12327):    at android.os.Handler.dispatchMessage(Handler.java:102)
12-11 17:46:21.451: E/AndroidRuntime(12327):    at android.os.Looper.loop(Looper.java:146)
12-11 17:46:21.451: E/AndroidRuntime(12327):    at android.app.ActivityThread.main(ActivityThread.java:5487)
12-11 17:46:21.451: E/AndroidRuntime(12327):    at java.lang.reflect.Method.invokeNative(Native Method)
12-11 17:46:21.451: E/AndroidRuntime(12327):    at java.lang.reflect.Method.invoke(Method.java:515)
12-11 17:46:21.451: E/AndroidRuntime(12327):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
12-11 17:46:21.451: E/AndroidRuntime(12327):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
12-11 17:46:21.451: E/AndroidRuntime(12327):    at dalvik.system.NativeStart.main(Native Method)
12-11 17:46:21.451: E/AndroidRuntime(12327): Caused by: java.lang.NullPointerException
12-11 17:46:21.451: E/AndroidRuntime(12327):    at com.example.feastapp.MainActivity.onCreate(MainActivity.java:77)
12-11 17:46:21.451: E/AndroidRuntime(12327):    at android.app.Activity.performCreate(Activity.java:5451)
12-11 17:46:21.451: E/AndroidRuntime(12327):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
12-11 17:46:21.451: E/AndroidRuntime(12327):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
12-11 17:46:21.451: E/AndroidRuntime(12327):    ... 11 more

这是一个非常令人困惑的情况,因为在更新之前,应用程序运行得很好。绝对没有对代码进行任何更改。目前,登录页面可以出现,但输入凭据并按下发送应用程序立即崩溃。关于如何缓解的任何想法?

0 个答案:

没有答案