Unable to do findElement by XPath when using device installed with Android 5.0

Good day,

I can’t seem to get any element via xpath when I try to automate using an Android 5.0 device. But when I try to run it using an Android 5.1 device, it works.

below are the logs thrown by Appium:

Using Android 5.0

info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:“//android.widget.CheckedTextView[contains(@text,‘AU Dev CI’)]”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.CheckedTextView[contains(@text,‘AU Dev CI’)] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Command returned error:java.lang.RuntimeException: Failed to Dump Window Hierarchy
info: [debug] Condition unmet after 3149ms. Timing out.
info: [debug] Responding to client with error: {“status”:13,“value”:{“message”:“An unknown server-side error occurred while processing the command.”,“origValue”:“Failed to Dump Window Hierarchy”},“sessionId”:“e5f4a81b-cdda-4b5b-b5f1-b728eb5d92bf”}
info: ← POST /wd/hub/session/e5f4a81b-cdda-4b5b-b5f1-b728eb5d92bf/element 500 3150.460 ms - 200
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:13,“value”:“Failed to Dump Window Hierarchy”}
info: [debug] Didn’t get a new command in 60 secs, shutting down…

Using Android 5.1:

info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:“//android.widget.CheckedTextView[contains(@text,‘AU Dev CI’)]”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.CheckedTextView[contains(@text,‘AU Dev CI’)] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[CLASS=android.widget.CheckedTextView, INSTANCE=3]
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:{“ELEMENT”:“1”}}
info: [debug] Responding to client with success: {“status”:0,“value”:{“ELEMENT”:“1”},“sessionId”:“367622a6-8d5f-4f92-94f2-f2c2e99c8070”}
info: ← POST /wd/hub/session/367622a6-8d5f-4f92-94f2-f2c2e99c8070/element 200 52.613 ms - 87 {“status”:0,“value”:{“ELEMENT”:“1”},“sessionId”:“367622a6-8d5f-4f92-94f2-f2c2e99c8070”}

Appium Version: 1.4.16.1 (Windows Platform)
Appium Webdriver version: 3.0.0.1