我从我的测试用户那里得到了关于奇怪崩溃的报告,他在索尼Experia Z1设备上安装了android 4.4.4。应用程序崩溃发生在几个小时的睡眠后应用程序从后台重新启动时。 这里崩溃日志:
E/AndroidRuntime(10562): Process: com.example.app, PID: 10562
E/AndroidRuntime(10562): java.lang.RuntimeException: Unable to create application com.example.MyApplication: java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy@45b256a8 (pid=997) when starting service Intent { cmp=com.example.app/com.example.services.exampleRequestService (has extras) }
E/AndroidRuntime(10562): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4465)
E/AndroidRuntime(10562): at android.app.ActivityThread.access$1500(ActivityThread.java:144)
E/AndroidRuntime(10562): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)
E/AndroidRuntime(10562): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(10562): at android.os.Looper.loop(Looper.java:212)
E/AndroidRuntime(10562): at android.app.ActivityThread.main(ActivityThread.java:5135)
E/AndroidRuntime(10562): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(10562): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(10562): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
E/AndroidRuntime(10562): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
E/AndroidRuntime(10562): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(10562): Caused by: java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy@45b256a8 (pid=997) when starting service Intent { cmp=com.example.app/com.example.services.exampleRequestService (has extras) }
E/AndroidRuntime(10562): at android.os.Parcel.readException(Parcel.java:1474)
E/AndroidRuntime(10562): at android.os.Parcel.readException(Parcel.java:1427)
E/AndroidRuntime(10562): at android.app.ActivityManagerProxy.startService(ActivityManagerNative.java:2989)
E/AndroidRuntime(10562): at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1546)
E/AndroidRuntime(10562): at android.app.ContextImpl.startService(ContextImpl.java:1528)
E/AndroidRuntime(10562): at android.content.ContextWrapper.startService(ContextWrapper.java:494)
E/AndroidRuntime(10562): at com.foxykeep.datadroid.requestmanager.RequestManager.execute(RequestManager.java:279)
E/AndroidRuntime(10562): at com.example.managers.BackgroundNetworkManager.loadAppConfig(BackgroundNetworkManager.java:82)
E/AndroidRuntime(10562): at com.example.MyApplication.onCreate(MyApplication.java:76)
E/AndroidRuntime(10562): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
E/AndroidRuntime(10562): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4462)
E/AndroidRuntime(10562): ... 10 more
D/AndroidRuntime(10588): Shutting down VM
W/dalvikvm(10588): threadid=1: thread exiting with uncaught exception (group=0x415cbd88)
E/AndroidRuntime(10575): FATAL EXCEPTION: main
E/AndroidRuntime(10575): Process: com.example.app, PID: 10575
E/AndroidRuntime(10575): java.lang.RuntimeException: Unable to create application com.example.MyApplication: java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy@45b21298 (pid=997) when starting service Intent { cmp=com.example.app/com.example.services.exampleRequestService (has extras) }
E/AndroidRuntime(10575): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4465)
E/AndroidRuntime(10575): at android.app.ActivityThread.access$1500(ActivityThread.java:144)
E/AndroidRuntime(10575): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)
E/AndroidRuntime(10575): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(10575): at android.os.Looper.loop(Looper.java:212)
E/AndroidRuntime(10575): at android.app.ActivityThread.main(ActivityThread.java:5135)
E/AndroidRuntime(10575): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(10575): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(10575): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
E/AndroidRuntime(10575): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
E/AndroidRuntime(10575): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(10575): Caused by: java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy@45b21298 (pid=997) when starting service Intent { cmp=com.example.app/com.example.services.exampleRequestService (has extras) }
E/AndroidRuntime(10575): at android.os.Parcel.readException(Parcel.java:1474)
E/AndroidRuntime(10575): at android.os.Parcel.readException(Parcel.java:1427)
E/AndroidRuntime(10575): at android.app.ActivityManagerProxy.startService(ActivityManagerNative.java:2989)
E/AndroidRuntime(10575): at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1546)
E/AndroidRuntime(10575): at android.app.ContextImpl.startService(ContextImpl.java:1528)
E/AndroidRuntime(10575): at android.content.ContextWrapper.startService(ContextWrapper.java:494)
E/AndroidRuntime(10575): at com.foxykeep.datadroid.requestmanager.RequestManager.execute(RequestManager.java:279)
E/AndroidRuntime(10575): at com.example.managers.BackgroundNetworkManager.loadAppConfig(BackgroundNetworkManager.java:82)
E/AndroidRuntime(10575): at com.example.MyApplication.onCreate(MyApplication.java:76)
E/AndroidRuntime(10575): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
E/AndroidRuntime(10575): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4462)
E/AndroidRuntime(10575): ... 10 more
V/GAV3 (10588): Thread[main,5,main]: Tracking Exception: SecurityException (@Parcel:readException:1474) {main}
V/GAV3 (10588): Thread[main,5,main]: Dispatch call queued. Dispatch will run once initialization is complete.
V/GAV3 (10588): Thread[main,5,main]: Passing exception to original handler.
E/AndroidRuntime(10588): FATAL EXCEPTION: main
E/AndroidRuntime(10588): Process: com.example.app, PID: 10588
E/AndroidRuntime(10588): java.lang.RuntimeException: Unable to create application com.example.MyApplication: java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy@45af4260 (pid=997) when starting service Intent { cmp=com.example.app/com.example.services.exampleRequestService (has extras) }
E/AndroidRuntime(10588): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4465)
E/AndroidRuntime(10588): at android.app.ActivityThread.access$1500(ActivityThread.java:144)
E/AndroidRuntime(10588): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)
E/AndroidRuntime(10588): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(10588): at android.os.Looper.loop(Looper.java:212)
E/AndroidRuntime(10588): at android.app.ActivityThread.main(ActivityThread.java:5135)
E/AndroidRuntime(10588): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(10588): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(10588): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
E/AndroidRuntime(10588): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
E/AndroidRuntime(10588): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(10588): Caused by: java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy@45af4260 (pid=997) when starting service Intent { cmp=com.example.app/com.example.services.exampleRequestService (has extras) }
E/AndroidRuntime(10588): at android.os.Parcel.readException(Parcel.java:1474)
E/AndroidRuntime(10588): at android.os.Parcel.readException(Parcel.java:1427)
E/AndroidRuntime(10588): at android.app.ActivityManagerProxy.startService(ActivityManagerNative.java:2989)
E/AndroidRuntime(10588): at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1546)
E/AndroidRuntime(10588): at android.app.ContextImpl.startService(ContextImpl.java:1528)
E/AndroidRuntime(10588): at android.content.ContextWrapper.startService(ContextWrapper.java:494)
E/AndroidRuntime(10588): at com.foxykeep.datadroid.requestmanager.RequestManager.execute(RequestManager.java:279)
E/AndroidRuntime(10588): at com.example.managers.BackgroundNetworkManager.loadAppConfig(BackgroundNetworkManager.java:82)
E/AndroidRuntime(10588): at com.example.MyApplication.onCreate(MyApplication.java:76)
E/AndroidRuntime(10588): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
E/AndroidRuntime(10588): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4462)
E/AndroidRuntime(10588): ... 10 more
I/Process (10575): Sending signal. PID: 10575 SIG: 9
I/Process (10562): Sending signal. PID: 10562 SIG: 9
此次崩溃后,app正常重启。 但我不能在我身边重现这个问题,似乎一切都对我很好 有人可以帮我解决这个问题吗?也有人知道,为什么应用程序重启同时在3个进程中发生,而不是在1中一般?