How to resolve org.openqa.selenium.WebDriverException: UiAutomator died issue

org.openqa.selenium.WebDriverException: UiAutomator died while responding to command, please check appium logs! (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 9.20 seconds
Build info: version: ‘2.48.2’, revision: ‘41bccdd10cf2c0560f637404c2d96164b67d9d67’, time: ‘2015-10-09 13:08:06’

There is not particular code i get this. Every time i am getting this error at new places in my automation suite.
I am facing this issue quite frequently. Can anyone please suggest some solution and explain what this means exactly.

can you please give more appium logs ?

e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“element:clear”,“params”:{“elementId”:“36”}}
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Got command action: clear
e[36minfoe[39m: [debug] [BOOTSTRAP] [debug] Attempting to clear using UiObject.clearText().
e[36minfoe[39m: [debug] Logcat terminated with code 0, signal null
e[36minfoe[39m: [debug] UiAutomator exited
e[36minfoe[39m: [debug] executing cmd: /Users/localadmin/Library/Android/sdk/platform-tools/adb -s 0ba5c131 shell “echo ‘ping’”
e[36minfoe[39m: [debug] Error: ADB ping failed, returned: * daemon not running. starting it now on port 5037 *

  • daemon started successfully *
    ping
    e[36minfoe[39m: [debug] Stopping logcat capture
    e[36minfoe[39m: [debug] Logcat already stopped
    e[36minfoe[39m: [debug] executing cmd: /Users/localadmin/Library/Android/sdk/platform-tools/adb -s 0ba5c131 kill-server
    e[36minfoe[39m: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
    e[36minfoe[39m: [debug] executing cmd: /Users/localadmin/Library/Android/sdk/platform-tools/adb -s 0ba5c131 wait-for-device
    e[36minfoe[39m: [debug] executing cmd: /Users/localadmin/Library/Android/sdk/platform-tools/adb -s 0ba5c131 shell “echo ‘ready’”
    e[36minfoe[39m: [debug] Starting logcat capture
    e[36minfoe[39m: [debug] Attempting to uninstall app
    e[36minfoe[39m: [debug] Not uninstalling app since server not started with --full-reset
    e[36minfoe[39m: [debug] Cleaning up android objects
    e[36minfoe[39m: [debug] Responding to client with error: {“status”:13,“value”:{“message”:“UiAutomator died while responding to command, please check appium logs!”,“name”:“UnknownError”,“origValue”:“UiAutomator died while responding to command, please check appium logs!”},“sessionId”:“140768a9-a5d5-4ee4-bf04-f1fed88710f9”}
    e[36minfoe[39m: [debug] Cleaning up appium session

After this failure i get sessionnotfound exception. Are both interlinked ? UIautomator died so it clears the appium session also ? is that the reason for exception ?

Yeah, both are linked, please tell me on which API Level you are working ?

use emulator that’s API level 18 or higher. However, API Level 17 was ok with appium 1.3.1.

I am using physical device with api level higher than 18.

Are you using the latest appium version ?

Appium 1.4.13(Draco)

This might be helpful to you:

have you tried with the latest appium version ?

not yet, our suit runs on this version. But the thing is it was running fine a week ago suddenly i started facing this issue on daily basis.

Please update Appium to latest version which is 1.7.2.

If still there are some dependency then try updating it to 1.4.16 which was the last stable version in 1.4 series and check.
Sometimes uiautomator issue arises in specific phone models

Try to update the appium, hope it will work :slight_smile:

I upgraded appium to v1.6.5 now i am getting following issue.

I am running 2 jenkins jobs

In one job got this error :

adb E 40073 1659583 usb_osx.cpp:322] Could not open interface: e00002c5
adb E 40073 1659583 usb_osx.cpp:284] Could not find device interface
adb E 40073 1659583 usb_osx.cpp:322] Could not open interface: e00002c5
adb E 40073 1659583 usb_osx.cpp:284] Could not find device interface
error: could not install smartsocket listener: Address already in use
ADB server didn’t ACK

  • failed to start daemon *
  • waiting for device -

In another job :----------------------------------------

----> INFO: [01-30-2018 01:48:10 007] Inside verifyOpenMyRidesDpl() method
dpl command is : adb -s 634caa6d0104 shell am start -a android.intent.action.VIEW -d some deeplink
[Logcat] Logcat terminated with code 0, signal null
[UiAutomator] UiAutomator exited unexpectedly with code 0, signal null
exit-status: 0
[ADB] Error: Error while getting connected devices. Original error: Command ‘/Users/localadmin/Library/Android/sdk/platform-tools/adb devices’ exited with code 1
at Object.wrappedLogger.errorAndThrow (…/…/lib/logging.js:63:13)
at ADB.callee$0$0$ (…/…/…/lib/tools/system-calls.js:123:9)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at

are you able to run adb commands ?

On terminal - yes i am able to run adb commands