AccessibilityNodeInfo returns null child for visible element

707 views
Skip to first unread message

Eric Millin

unread,
Dec 17, 2014, 9:53:30 PM12/17/14
to adt...@googlegroups.com
I'm seeing intermittent behavior where UiAutomator returns null for an element that is visible.  This happens about 25% of the time when searching by description or text on an emulator running API 19.  I'm using the 4.4.2r3 android jar.

QueryController(2291): AccessibilityNodeInfo returned a null child (1 of 2)
QueryController(2291): parent = android.view.accessibility.AccessibilityNodeInfo@1a455; boundsInParent: Rect(0, 0 - 480, 57); boundsInScreen: Rect(0, 648 - 480, 705); packageName: my.launcher; className: android.widget.LinearLayout; text: null; contentDescription: null; viewIdResName: my.launcher:id/bottom_btns; checkable: false; checked: false; focusable: false; focused: false; selected: false; clickable: false; longClickable: false; enabled: true; password: false; scrollable: false; [ACTION_SELECT, ACTION_CLEAR_SELECTION, ACTION_ACCESSIBILITY_FOCUS]

Once it occurs the element remains undiscoverable regardless of how many times the search executes.  The element is also missing from UI xml dumps.  I tried refreshing the AccessibilityNodeInfo object but that doesn't help.  The element does not have an accessibility ID.  My understanding is the element has visibility set to View.GONE when it is created, but then changes to visible.

I've confirmed this behavior with other developers, so I'm confident it's not localized to my machine (or my chair ;) ).  Any help would be greatly appreciated.

bootstraponline

unread,
Feb 13, 2015, 4:11:20 PM2/13/15
to adt...@googlegroups.com
This is a known bug in the accessibility framework. Other than adding null checks, there doesn't seem to be a good work around.
https://code.google.com/p/android/issues/detail?id=58733#c4
Reply all
Reply to author
Forward
0 new messages