NPE on com.android.server.autofill.RemoteFillService$PendingRequest.cancel()
Asked Answered
A

1

28

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.

Axum answered 18/9, 2018 at 11:30 Comment(9)
Possible duplicate of What is a NullPointerException, and how do I fix it?Gayn
@Gayn , This is not just null pointer exception. It is located at com.android.server.autofill.RemoteFillService$PendingRequest.cancel(). I don't know how to solve it because this is not coming in my codeAxum
Any solution for this issue. Seems to be new one.Coopery
Have you managed to find out what causes this?Savannahsavant
Same problem and no idea why this is happens ?Tonguing
@SanjayKumar Did you get any lead? I got the same.Overvalue
@Rakesh, I did't find any solution.Axum
@SanjayKumar I've raised it to Google. Let's see.Overvalue
FWIW, I am getting this error from users with Xiaomi Mi A1 device running Android 9 (Pie).Exemplum
J
13

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

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

Jeavons answered 10/6, 2019 at 0:46 Comment(5)
Can you back your claim that setting importanForAutofill to no will avoid this crash? Have you successfully reproduced the crash and tested the avoidance with that setting? Or at least eliminated the crash on your remote user devices?Exemplum
I was not able to reproduce the crash. I did however tested using an edittext with autofill then disabled the autofill by calling importantForAutofill on my oncreate. It worked on disabling autofill. As for the crash let me try to test it more on my side.Jeavons
Hello. I would like to know if you use TextInputLayout in you application. If so can you paste a copy of the layout file that has this.Jeavons
It is a super interactive app and there are bunch of them, but here is one: gist.github.com/ozbek/6e1cf0a878efbffa383e87ffd2cdb4bbExemplum
I have received crash reports from Google devices too (Pixel 2 XL and Pixel 3, both running Android 9).Howlyn

© 2022 - 2024 — McMap. All rights reserved.