appium: UiAutomator exited unexpectedly with code 0, signal null
The problem
Script runs fine on Android 5.1 device, but gives “UiAutomator exited unexpectedly with code 0, signal null” when executed on Android 5.1 emulator or devices/emulators with higher Android versions.
New to Appium, any help would be highly appreciated! Thank you.
Environment
Android Studio - 2.3.1 Selenium - 3.3.1 TestNG - 6.9.10 Appium - 1.6.4 OS- Windows Platform - Android
Details
This script runs fine on Moto G, Android 5.1, API level 22, test completes successfully. However, when I try to run this on Android 5.1 emulator, Samsung Galaxy S7 - Android 6.0.1 and Samsung Galaxy S8+ - Android 7.0, the Gradle build completes successfully but test doesn’t launch and Appium server (1.6.4) gives error - “UiAutomator exited unexpectedly with code 0, signal null” .
Link to Appium logs
https://gist.github.com/HS1219/042e7dd3a82a0547bd2d9bfb9b962477
Code To Reproduce Issue [ Good To Have ]
WebDriver driver;
@Before
public void setUp() throws MalformedURLException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "Moto G");
capabilities.setCapability("newCommandTimeout", 120);
//capabilities.setCapability("chromedriverExecutable", "C://Users//Eclipse//Drivers//chromedriver.exe");
capabilities.setCapability(CapabilityType.BROWSER_NAME, "Chrome");
capabilities.setCapability("launchTimeout", "100000");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability(CapabilityType.VERSION, "5.1");
//capabilities.setCapability("appPackage", "com.android.launcher");
//capabilities.setCapability("appActivity", "com.google.android.apps.chrome.Main");
driver = new RemoteWebDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
driver.navigate().to("http://www.google.com");
System.out.println("Android Device browser launched successfully");
}
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 37 (5 by maintainers)
I was able to resolve my issue: updated SDK and all related components to the latest one.
Good to hear @nurayttumer
^ @jlipps @imurchie @mykola-mokhnach I think we need to do push people towards always setting the
automationName
. This is tripping a lot of people up and I think it’s causing a bad experience for folks who are new to Appium.I think we should consider making
automationName
a required capability now, instead of waiting until Appium 2.0brew upgrade install android-platform-tools
Try this. It worked for me.