UiAutomator exited unexpectedly with code 4294967295, signal null

Appium shutting down

base.java

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.remote.MobileCapabilityType;

public class base {

public static AndroidDriver<AndroidElement> Capabilities() throws MalformedURLException {
	// TODO Auto-generated method stub
	
	//this is used to get the path of the apk file located in the project
	File f = new File("src");
	File fs = new File(f,"ApiDemos-debug.apk");
	
	//Created a desired capabilities object to set Emulator, and provide the app to test on.
	DesiredCapabilities cap = new DesiredCapabilities();
	cap.setCapability(MobileCapabilityType.DEVICE_NAME, "PixelXL");
	cap.setCapability(MobileCapabilityType.APP , fs.getAbsolutePath());
	
	//create a android driver object. arguments takes 1. the host url object 2.desired cap
	AndroidDriver<AndroidElement> driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"),cap);
	return driver;
}

}


xpathDetectio.java

import java.net.MalformedURLException;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebElement;

import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;

public class xpathDetection extends base {

public static void main(String[] args) throws MalformedURLException {
	
			AndroidDriver<AndroidElement> driver = Capabilities();
			
			driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
			
			//Xpath Syntax //tagName[@attribute='value']
			
			driver.findElementByXPath("//android.widget.TextView[@text='Preference']").click();
			driver.findElementByAndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().textContains(\"Preference\").instance(0))");
			driver.findElementByXPath("//android.widget.TextView[@text='3. Preference dependencies']").click();
			
			driver.findElementById("android:id/checkbox").click();
			driver.findElementByXPath("(//android.widget.RelativeLayout)[2]").click();
			driver.findElementByClassName("android.widget.EditText").sendKeys("Gocanvas WiFi");
			driver.findElementsByClassName("android.widget.Button").get(1).click();
			
}

}


Appium log
[HTTP] {“desiredCapabilities”:{“app”:“C:\Users\saurabh.deshpande\eclipse-workspace\AppiumBasics\src\ApiDemos-debug.apk”,“platformName”:“Android”,“deviceName”:“PixelXL”},“capabilities”:{“desiredCapabilities”:{“app”:“C:\Users\saurabh.deshpande\eclipse-workspace\AppiumBasics\src\ApiDemos-debug.apk”,“deviceName”:“PixelXL”,“platformName”:“Android”},“firstMatch”:[{“platformName”:“android”}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{“app”:“C:\Users\saurabh.deshpande\eclipse-workspace\AppiumBasics\src\ApiDemos-debug.apk”,“platformName”:“Android”,“deviceName”:“PixelXL”},null,{“desiredCapabilities”:{“app”:“C:\Users\saurabh.deshpande\eclipse-workspace\AppiumBasics\src\ApiDemos-debug.apk”,“deviceName”:“PixelXL”,“platformName”:“Android”},“firstMatch”:[{“platformName”:“android”}]}]
[debug] [BaseDriver] Event ‘newSessionRequested’ logged at 1531942284188 (15:31:24 GMT-0400 (Eastern Daylight Time))
[Appium] Could not parse W3C capabilities: ‘deviceName’ can’t be blank. Falling back to JSONWP protocol.
[Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: [“app”,“platformName”,“deviceName”]. Falling back to JSONWP protocol.
[Appium] Creating new AndroidDriver (v2.7.0) session
[Appium] Capabilities:
[Appium] app: C:\Users\saurabh.deshpande\eclipse-workspace\AppiumBasics\src\ApiDemos-debug.apk
[Appium] platformName: Android
[Appium] deviceName: PixelXL
[debug] [BaseDriver] Creating session with MJSONWP desired capabilities: {“app”:“C:\Users\saurabh…
[BaseDriver] Session created with session id: 4a9c8d33-514f-4219-a437-488fe5c872f9
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 10.0.1
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[AndroidDriver] Using device: emulator-5554
[debug] [ADB] Setting device id to emulator-5554
[BaseDriver] Using local app ‘C:\Users\saurabh.deshpande\eclipse-workspace\AppiumBasics\src\ApiDemos-debug.apk’
[debug] [AndroidDriver] Checking whether app is actually present
[AndroidDriver] Starting Android session
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 wait-for-device’
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell echo ping’
[debug] [AndroidDriver] Pushing settings apk to device…
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list packages io.appium.settings’
[debug] [ADB] App is installed
[debug] [ADB] Getting package info for ‘io.appium.settings’
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings’
[ADB] Checking whether aapt is present
[ADB] Using aapt.exe from C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\build-tools\28.0.1\aapt.exe
[debug] [ADB] The installed ‘io.appium.settings’ package does not require upgrade (‘2.3.0’ >= ‘2.3.0’)
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell ps’
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk’
[debug] [ADB] Current device property ‘ro.build.version.sdk’: 28
[debug] [ADB] Device API level: 28
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -W -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’
[debug] [ADB] Device API level: 28
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell appops set io.appium.settings android:mock_location allow’
[AndroidDriver] setDeviceLanguageCountry requires language or country.
[AndroidDriver] Got language: ‘null’ and country: ‘null’
[debug] [Logcat] Starting logcat capture
[debug] [AndroidDriver] Pushing unlock helper app to device…
[debug] [ADB] Getting install status for io.appium.unlock
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list packages io.appium.unlock’
[debug] [ADB] App is installed
[debug] [ADB] Getting package info for ‘io.appium.unlock’
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.unlock’
[debug] [ADB] The installed ‘io.appium.unlock’ package does not require upgrade (‘2.0.0’ >= ‘2.0.0’)
[ADB] Getting device platform version
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.release’
[debug] [ADB] Current device property ‘ro.build.version.release’: 9
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell wm size’
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.product.model’
[debug] [ADB] Current device property ‘ro.product.model’: Android SDK built for x86
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.product.manufacturer’
[debug] [ADB] Current device property ‘ro.product.manufacturer’: Google
[debug] [AndroidDriver] Parsing package and activity from app manifest
[ADB] Using the alternative activity name detection method because of: Could not find apkanalyzer.bat in C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\apkanalyzer.bat,C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\emulator\apkanalyzer.bat,C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\tools\apkanalyzer.bat,C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\tools\bin\apkanalyzer.bat,C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\build-tools\28.0.1\apkanalyzer.bat,C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\build-tools\27.0.3\apkanalyzer.bat,C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\build-tools\26.0.2\apkanalyzer.bat. Do you have the Android SDK installed at ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk’?
[ADB] Extracting package and launch activity from manifest
[ADB] Package name: ‘io.appium.android.apis’
[ADB] Main activity name: ‘io.appium.android.apis.ApiDemos’
[debug] [AndroidDriver] Parsed package and activity are: io.appium.android.apis/io.appium.android.apis.ApiDemos
[debug] [ADB] Getting install status for io.appium.android.apis
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list packages io.appium.android.apis’
[debug] [ADB] App is installed
[debug] [ADB] Getting install status for io.appium.android.apis
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list packages io.appium.android.apis’
[debug] [ADB] App is installed
[debug] [ADB] Getting package info for ‘io.appium.android.apis’
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.android.apis’
[ADB] Cannot read version codes of ‘C:\Users\saurabh.deshpande\eclipse-workspace\AppiumBasics\src\ApiDemos-debug.apk’ and/or ‘io.appium.android.apis’
[ADB] Cannot read version names of ‘C:\Users\saurabh.deshpande\eclipse-workspace\AppiumBasics\src\ApiDemos-debug.apk’ and/or ‘io.appium.android.apis’. Assuming correct app version is already installed
[AndroidDriver] Performing fast reset on ‘io.appium.android.apis’
[debug] [ADB] Getting install status for io.appium.android.apis
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list packages io.appium.android.apis’
[debug] [ADB] App is installed
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.android.apis’
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm clear io.appium.android.apis’
[debug] [AndroidDriver] Performed fast reset on the installed ‘io.appium.android.apis’ application (stop and clear)
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell rm -rf /data/local/tmp/strings.json’
[debug] [AndroidDriver] Extracting strings from apk
[debug] [AndroidDriver] C:\Users\saurabh.deshpande\eclipse-workspace\AppiumBasics\src\ApiDemos-debug.apk
[debug] [AndroidDriver] null
[debug] [AndroidDriver] C:\Users\SAURAB~1.DES\AppData\Local\Temp\io.appium.android.apis
[debug] [ADB] Extracting strings for language: default
[ADB] Successfully extracted 942 strings from ‘C:\Users\saurabh.deshpande\eclipse-workspace\AppiumBasics\src\ApiDemos-debug.apk’ resources for ‘(default)’ configuration
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 push C:\Users\SAURAB~1.DES\AppData\Local\Temp\io.appium.android.apis\strings.json /data/local/tmp’
[debug] [AndroidBootstrap] Watching for bootstrap disconnect
[debug] [ADB] Forwarding system: 4724 to device: 4724
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward tcp:4724 tcp:4724’
[debug] [UiAutomator] Starting UiAutomator
[debug] [UiAutomator] Moving to state ‘starting’
[debug] [UiAutomator] Parsing uiautomator jar
[debug] [UiAutomator] Found jar name: ‘AppiumBootstrap.jar’
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 push C:\Users\saurabh.deshpande\AppData\Roaming\npm\node_modules\appium\node_modules\appium-android-bootstrap\bootstrap\bin\AppiumBootstrap.jar /data/local/tmp/’
[debug] [ADB] Attempting to kill all uiautomator processes
[debug] [ADB] Getting all processes with uiautomator
[debug] [ADB] Running ‘C:\Users\saurabh.deshpande\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell ps’
[ADB] No uiautomator process found to kill, continuing…
[debug] [UiAutomator] Starting UIAutomator
[debug] [ADB] Creating ADB subprocess with args: [”-P",5037,"-s",“emulator-5554”,“shell”,“uiautomator”,“runtest”,“AppiumBootstrap.jar”,"-c",“io.appium.android.bootstrap.Bootstrap”,"-e",“pkg”,“io.appium.android.apis”,"-e",“disableAndroidWatchers”,false,"-e",“acceptSslCerts”,false]
[UiAutomator] UiAutomator exited unexpectedly with code 4294967295, signal null
[debug] [UiAutomator] Moving to state ‘stopped’
Unhandled rejection Error: UiAUtomator shut down unexpectedly
at AndroidBootstrap.callee$2$0$ (C:\Users\saurabh.deshpande\AppData\Roaming\npm\node_modules\appium\node_modules\appium-android-bootstrap\lib\bootstrap.js:177:42)
at tryCatch (C:\Users\saurabh.deshpande\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\saurabh.deshpande\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\saurabh.deshpande\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at invoke (C:\Users\saurabh.deshpande\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
at enqueueResult (C:\Users\saurabh.deshpande\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:185:17)
at new Promise ()
at new F (C:\Users\saurabh.deshpande\AppData\Roaming\npm\node_modules\appium\node_modules\core-js\library\modules$.export.js:30:36)
at AsyncIterator.enqueue (C:\Users\saurabh.deshpande\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:184:12)
at AsyncIterator.prototype.(anonymous function) [as next] (C:\Users\saurabh.deshpande\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at Object.runtime.async (C:\Users\saurabh.deshpande\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:209:12)
at UiAutomator.callee$2$0 (C:\Users\saurabh.deshpande\AppData\Roaming\npm\node_modules\appium\node_modules\appium-android-bootstrap\build\lib\bootstrap.js:357:42)
at emitOne (events.js:116:13)
at UiAutomator.emit (events.js:211:7)
at UiAutomator.changeState (C:\Users\saurabh.deshpande\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator\lib\uiautomator.js:85:10)
at SubProcess. (C:\Users\saurabh.deshpande\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator\lib\uiautomator.js:47:14)
at emitTwo (events.js:126:13)
at SubProcess.emit (events.js:214:7)
at ChildProcess. (C:\Users\saurabh.deshpande\AppData\Roaming\npm\node_modules\appium\node_modules\teen_process\lib\subprocess.js:130:14)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)