问题描述
Crashlytics报告与自动填充相关的NullPointerException
,如下所示:
Crashlytics is reporting NullPointerException
related to Auto Fill as shown below:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method
'boolean com.android.server.autofill.RemoteFillService$PendingRequest.cancel()' on a null object reference
at android.os.Parcel.readException(Parcel.java:1965)
at android.os.Parcel.readException(Parcel.java:1905)
at android.app.IActivityManager$Stub$Proxy.reportAssistContextExtras(IActivityManager.java:8297)
at android.app.ActivityThread.handleRequestAssistContextExtras(ActivityThread.java:3210)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by android.os.RemoteException: Remote stack trace:
at com.android.server.autofill.RemoteFillService.cancelCurrentRequest(RemoteFillService.java:177)
at com.android.server.autofill.Session.cancelCurrentRequestLocked(Session.java:465)
at com.android.server.autofill.Session.access$1000(Session.java:118)
at com.android.server.autofill.Session$1.onHandleAssistData(Session.java:322)
at com.android.server.am.ActivityManagerService.reportAssistContextExtras(ActivityManagerService.java:14713)
但是,堆栈中没有包含我的应用程序中的任何内容,但崩溃发生在我这边.
However, the stack does not include anything from my app yet crash is happening on my side.
推荐答案
这不是您的应用的问题,而是特定的Android OEM.似乎在三星设备上发生的频率更高,而在像素设备上则没有.这是给Google的问题报告,显示为无法解决". https://issuetracker.google.com/issues/123311621
This is not an issue with your app but with specific Android OEMs. Seems to be happening more frequently on Samsung Devices and not seen on Pixel Devices. Here is an issue report to Google which is closed as 'Won't Fix'.https://issuetracker.google.com/issues/123311621
由于崩溃是由于自动填充而发生的.我建议通过将importanForAutofill设置为false/no来禁用特定视图的自动填充. https://developer.android.com/reference/android/R.attr .html#importantForAutofill
Since the crash is happening because of autofill. I would recommend disabling autofill for the specific view by setting importanForAutofill as false/no.https://developer.android.com/reference/android/R.attr.html#importantForAutofill
这篇关于com.android.server.autofill.RemoteFillService $ PendingRequest.cancel()上的NPE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!