In our Android application (compatible with Android version 4.0 and above), we use the Google Maps V2 API.
We get some error messages from users on certain types of devices (versions of Android 4.3, 4.4 and 5.0) using the NullPointerException in the setBoundsInParent method of the android.view.accessibility.AccessibilityNodeInfo class.
The application crashes when the user tries to move or scale the map.
The problem occurs only for some users - devices. Most of our customers do not have this problem.
The problem seems to be related to using the setPadding method of the Google Maps API to place the Google logo so that it is always clearly visible on the map :
@Override protected void onCreate(Bundle savedInstanceState) { ...
Removing the call to the setPadding method seems to solve the problem for the affected users, but this is not suitable for us, because we need to place the Google logo using this method.
We cannot reproduce this problem on our development devices, therefore it is difficult for us to find the real origin of this problem.
Below you will find the full stack of this error.
Does anyone have any ideas?
Thank you very much for your response.
Sincerely.
Stacktrace on Android 4.3 - 4.4
java.lang.NullPointerException at android.view.accessibility.AccessibilityNodeInfo.setBoundsInParent(AccessibilityNodeInfo.java:1012) at android.support.v4.view.akc(SourceFile:819) at android.support.v4.view.aib(SourceFile:1850) at com.google.maps.api.android.lib6.c.et.a(Unknown Source) at android.support.v4.widget.ab.a(SourceFile:56) at android.support.v4.widget.ac.a(SourceFile:717) at android.support.v4.view.axa(SourceFile:112) at android.support.v4.view.a.ad.createAccessibilityNodeInfo(SourceFile:42) at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchAccessibilityNodeInfos(AccessibilityInteractionController.java:724) at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread(AccessibilityInteractionController.java:147) at android.view.AccessibilityInteractionController.access$300(AccessibilityInteractionController.java:49) at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:971) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5212) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602) at dalvik.system.NativeStart.main(Native Method)
Stacktrace on Android 5.0
java.lang.NullPointerException: Attempt to read from field 'int android.graphics.Rect.left' on a null object reference at android.view.accessibility.AccessibilityNodeInfo.setBoundsInParent(AccessibilityNodeInfo.java:1316) at android.support.v4.view.akc(SourceFile:819) at android.support.v4.view.aib(SourceFile:1850) at com.google.maps.api.android.lib6.c.et.a(Unknown Source) at android.support.v4.widget.ab.a(SourceFile:56) at android.support.v4.widget.ac.a(SourceFile:717) at android.support.v4.view.axa(SourceFile:112) at android.support.v4.view.a.ad.createAccessibilityNodeInfo(SourceFile:42) at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchAccessibilityNodeInfos(AccessibilityInteractionController.java:894) at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread(AccessibilityInteractionController.java:155) at android.view.AccessibilityInteractionController.access$400(AccessibilityInteractionController.java:53) at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:1236) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5221) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)