Getting an exception "UiAUtomator shut down unexpectedly" while testing android native app using appium

Hi ,
I am automating the native andriod app using below softwares.
Appium Verison: 1.6.5
Java: 1.8
Selenium: 2.53
Appium Java-cleint: 4.1.2

Getting an exception “UiAUtomator shut down unexpectedly” while running the scripts in batch and not using the capabillity as capabilities.setCapability(“automationName”, “uiautomator2”)

I have seen may times this exception in local emulators, physcial devices and cloud real devices also.Can you please explain what could be the issue for this exception.

Appium Log:
roidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:setText”,“params”:{“elementId”:“12”,“text”:“[email protected]”,“replace”:false,“unicodeKeyboard”:true}}
07:32:17 V [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
07:32:17 V [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: setText
07:32:17 V [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using element passed in: 12
07:32:17 V [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Attempting to clear using UiObject.clearText().
07:32:19 V [Logcat] Logcat terminated with code 0, signal null
07:32:19 V [UiAutomator] UiAutomator exited unexpectedly with code 0, signal null
07:32:19 V [debug] [UiAutomator] Moving to state ‘stopped’
07:32:19 V [debug] [AndroidDriver] Shutting down Android driver
07:32:19 V [Appium] Closing session, cause was ‘UiAUtomator shut down unexpectedly’
07:32:19 V [Appium] Removing session 68c08b22-a066-4eca-bee5-5f44e2518bcb from our master session list
07:32:19 V [debug] [AndroidDriver] Resetting IME to com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME
07:32:19 V [debug] [ADB] Getting connected devices…
07:32:19 V [MJSONWP] Encountered internal error running command: Error: UiAUtomator shut down unexpectedly
07:32:19 V at AndroidBootstrap.callee$2$0$ (…/…/lib/bootstrap.js:76:44)
07:32:19 V at tryCatch (/root/appium/appium/1.6.5/node_modules/babel-runtime/regenerator/runtime.js:67:40)
07:32:19 V at GeneratorFunctionPrototype.invoke [as _invoke] (/root/appium/appium/1.6.5/node_modules/babel-runtime/regenerator/runtime.js:315:22)
07:32:19 V at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/root/appium/appium/1.6.5/node_modules/babel-runtime/regenerator/runtime.js:100:21)
07:32:19 V at invoke (/root/appium/appium/1.6.5/node_modules/babel-runtime/regenerator/runtime.js:136:37)
07:32:19 V at enqueueResult (/root/appium/appium/1.6.5/node_modules/babel-runtime/regenerator/runtime.js:185:17)
07:32:19 V at new Promise (/root/appium/appium/1.6.5/node_modules/core-js/library/modules/es6.promise.js:201:7)
07:32:19 V at AsyncIterator.enqueue (/root/appium/appium/1.6.5/node_modules/babel-runtime/regenerator/runtime.js:184:12)
07:32:19 V at AsyncIterator.prototype.(anonymous function) [as next] (/root/appium/appium/1.6.5/node_modules/babel-runtime/regenerator/runtime.js:100:21)
07:32:19 V at Object.runtime.async (/root/appium/appium/1.6.5/node_modules/babel-runtime/regenerator/runtime.js:209:12)
07:32:19 V at UiAutomator.callee$2$0 (…/…/lib/bootstrap.js:73:64)
07:32:19 V at emitOne (events.js:77:13)
07:32:19 V at UiAutomator.emit (events.js:169:7)
07:32:19 V at UiAutomator.changeState (…/…/lib/uiautomator.js:85:10)
07:32:19 V at SubProcess. (…/…/lib/uiautomator.js:47:14)
07:32:19 V at emitTwo (events.js:87:13)
07:32:19 V at SubProcess.emit (events.js:172:7)
07:32:19 V at ChildProcess. (…/…/lib/teen_process.js:205:14)
07:32:19 V at emitTwo (events.js:87:13)
07:32:19 V at ChildProcess.emit (events.js:172:7)
07:32:19 V at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
07:32:19 V [HTTP] <-- POST /wd/hub/session/68c08b22-a066-4eca-bee5-5f44e2518bcb/element/12/value 500 1412 ms - 205
07:32:19 V [debug] [ADB] 0 device(s) connected
07:32:19 V Unhandled rejection Error: No device connected, cannot run adb shell command ‘ime set com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME’
07:32:19 V at ADB.callee$0$0$ (…/…/…/lib/tools/system-calls.js:237:11)
07:32:19 V at tryCatch (/root/appium/appium/1.6.5/node_modules/babel-runtime/regenerator/runtime.js:67:40)
07:32:19 V at GeneratorFunctionPrototype.invoke [as _invoke] (/root/appium/appium/1.6.5/node_modules/babel-runtime/regenerator/runtime.js:315:22)
07:32:19 V at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/root/appium/appium/1.6.5/node_modules/babel-runtime/regenerator/runtime.js:100:21)
07:32:19 V at GeneratorFunctionPrototype.invoke (/root/appium/appium/1.6.5/node_modules/babel-runtime/regenerator/runtime.js:136:37)
07:32:19 V at run (/root/appium/appium/1.6.5/node_modules/core-js/library/modules/es6.promise.js:108:47)
07:32:19 V at /root/appium/appium/1.6.5/node_modules/core-js/library/modules/es6.promise.js:119:28
07:32:19 V at flush (/root/appium/appium/1.6.5/node_modules/core-js/library/modules/$.microtask.js:19:5)
07:32:19 V at doNTCallback0 (node.js:430:9)
07:32:19 V at process._tickCallback (node.js:359:13)
07:32:19 V [HTTP] --> DELETE /wd/hub/session/68c08b22-a066-4eca-bee5-5f44e2518bcb {}
07:32:19 V [HTTP] <-- DELETE /wd/hub/session/68c08b22-a066-4eca-bee5-5f44e2518bcb 404 2 ms - 131