java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List android.content.pm.PackageManager.queryIntentActivities
gfollower opened this issue · comments
Fastbot打开应用Activity报空指针导致UI crash:
java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List android.content.pm.PackageManager.queryIntentActivities(android.content.Intent, int)' on a null object reference
以下为具体Log:
[Test App]: com.scenicandroid.butterflyforrestlwp
[Test Env]: enable android ui framework reboot
[Fastbot Log]:
06-06 13:00:44.138 25466 25466 I [Fastbot]: // runing fastbot
06-06 13:00:44.176 25466 25466 I [Fastbot]: InputMethod ID: com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME
06-06 13:00:44.177 25466 25466 I [Fastbot]: InputMethod ID: com.google.android.tts/com.google.android.apps.speech.tts.googletts.settings.asr.voiceime.VoiceInputMethodService
06-06 13:00:44.177 25466 25466 I [Fastbot]: InputMethod ID: com.koushikdutta.vysor/.VysorIME
06-06 13:00:44.207 25466 25466 I [Fastbot]: // device serial number is xxxxxxx
...
06-06 13:00:44.312 2711 2766 W system_server: Long monitor contention with owner android.ui (2764) at int com.android.server.wm.ActivityStarter.execute()(ActivityStarter.java:798) waiters=0 in void com.android.server.wm.ActivityRecord$2.run() for 430ms
06-06 13:00:44.312 2711 2764 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: android.ui
06-06 13:00:44.312 2711 2764 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List android.content.pm.PackageManager.queryIntentActivities(android.content.Intent, int)' on a null object reference
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at android.os.Parcel.createExceptionOrNull(Parcel.java:3063)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at android.os.Parcel.createException(Parcel.java:3041)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:3024)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:2966)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at android.app.IActivityController$Stub$Proxy.activityStarting(IActivityController.java:267)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1153)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:753)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.wm.ActivityStartController.startHomeActivity(ActivityStartController.java:198)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.wm.RootWindowContainer.startHomeOnTaskDisplayArea(RootWindowContainer.java:1466)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.wm.RootWindowContainer.lambda$startHomeOnDisplay$11(RootWindowContainer.java:1407)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.wm.RootWindowContainer.$r8$lambda$zDbqLY8yVs2-CTsfHP7FhguhRoM(RootWindowContainer.java:0)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.wm.RootWindowContainer$$ExternalSyntheticLambda4.apply(R8$$SyntheticClass:0)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.wm.TaskDisplayArea.reduceOnAllTaskDisplayAreas(TaskDisplayArea.java:507)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.wm.DisplayArea.reduceOnAllTaskDisplayAreas(DisplayArea.java:527)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.wm.DisplayArea.reduceOnAllTaskDisplayAreas(DisplayArea.java:527)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.wm.DisplayArea.reduceOnAllTaskDisplayAreas(DisplayArea.java:527)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.wm.DisplayArea.reduceOnAllTaskDisplayAreas(DisplayArea.java:527)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.wm.DisplayArea.reduceOnAllTaskDisplayAreas(DisplayArea.java:527)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.wm.WindowContainer.reduceOnAllTaskDisplayAreas(WindowContainer.java:2412)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.wm.RootWindowContainer.startHomeOnDisplay(RootWindowContainer.java:1406)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.wm.ActivityTaskManagerService$LocalService.startHomeOnDisplay(ActivityTaskManagerService.java:6242)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.policy.PhoneWindowManager.startDockOrHome(PhoneWindowManager.java:5782)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.policy.PhoneWindowManager.startDockOrHome(PhoneWindowManager.java:5787)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.policy.PhoneWindowManager.launchHomeFromHotKey(PhoneWindowManager.java:3874)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.policy.PhoneWindowManager.launchHomeFromHotKey(PhoneWindowManager.java:3826)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.policy.PhoneWindowManager.handleShortPressOnHome(PhoneWindowManager.java:1712)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.policy.PhoneWindowManager.-$$Nest$mhandleShortPressOnHome(PhoneWindowManager.java:0)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.policy.PhoneWindowManager$DisplayHomeButtonHandler.lambda$handleHomeButton$0(PhoneWindowManager.java:1876)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.policy.PhoneWindowManager$DisplayHomeButtonHandler.$r8$lambda$hXFruVBER4PKCDllpR87SxOxpM4(PhoneWindowManager.java:0)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.policy.PhoneWindowManager$DisplayHomeButtonHandler$$ExternalSyntheticLambda0.run(R8$$SyntheticClass:0)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:958)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:205)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at android.os.Looper.loop(Looper.java:294)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:67)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.ServiceThread.run(ServiceThread.java:46)
06-06 13:00:44.312 2711 2764 E AndroidRuntime: at com.android.server.UiThread.run(UiThread.java:45)
06-06 13:00:44.312 2711 12952 W system_server: Long monitor contention with owner android.ui (2764) at int com.android.server.wm.ActivityStarter.execute()(ActivityStarter.java:798) waiters=1 in int com.android.server.wm.WindowProcessController.computeRelaunchReason() for 409ms
...
06-06 13:00:44.321 25466 25563 I [Fastbot]: // crash processName: com.android.launcher3, is not testing app
请更新最新版本jar? 设备是什么厂商设备?Android版本多少
已经是最新版本的jar了,使用的是原生Android 14.
执行时报空指针的概率很大,有时候又是正常的,大佬看下是否先加个判断?不然直接crash了
2.3.23.0810.1705-git 已修改可重新试下
2.3.23.0810.1705-git 已修改可重新试下
Fastbot_Anroid main分支上没看到有更新啊,是更新到其他地方了吗