I need to use Visual Studio, Eclipse is not an option for other reasons. Appium .net driver version 1.2.0.6 was installed via NuGeT.
The phone is a Samsung Galaxy Ace 3, running 4.2.2 (API level 17). USB drivers are installed, adb recognizes the phone and USB debugging is enabled.
I do not have access to the app’s source code, only the apk (it’s a third party app done for my company)
JDK 1.7.0.51, PATH set.
Android API 17 installed, SDK-Tools 24, Platform-tools 21, Build-tools 21.1.1, PATH values and ANDROID_HOME set.
I wanted to try out the FindElementsByAndroidUIAutomator method with the following class:
using System;
using Automation.Helpers;
using OpenQA.Selenium;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Remote;
using System.Collections.Generic;
using System.Threading;
using System.Drawing;
namespace Automation
{
public static class TestClass2
{
public static AppiumDriver driver;
public static DesiredCapabilities capabilities;
public static void run()
{
capabilities = Caps.androidGalaxyAce3Caps(Apps.get("2_android_uat"));
try
{
driver = new AppiumDriver(new Uri("http://127.0.0.1:4723/wd/hub"), capabilities);
}
catch (Exception)
{
throw;
}
Thread.Sleep(5000);
// http://developer.android.com/tools/help/uiautomator/UiSelector.html
var asd = driver.FindElementsByAndroidUIAutomator("new UiSelector().clickable(true)");
return;
}
}
}
Capabilities: appium-version is set to “1.3” platformName is set to “Android” platformVersion is set to “4.2.2”
the rest is configured according to the apk.
I put a breakpoint on return, and wanted to check out the contents of asd.
After the app is deployed and loaded on the phone, the execution halts with an exception:
UiAutomator died while responding to command, please check appium logs!
The appium server logs contain the following:
info: [debug] [UIAUTOMATOR STDOUT] Error in testRunServer:
info: [debug] [UIAUTOMATOR STDOUT] java.lang.NoClassDefFoundError: com.android.uiautomator.core.Configurator
info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.AndroidElement.(AndroidElement.java:26)
… trace continues but did not want this post to be superlong
I tried creating a global CLASSPATH variable, and setting it to a folder containing the extracted uiautomator.jar file so that it would find the class, but it didn’t really work out.
Does this mean that appium can’t be used for API level 18 or lower any more?
Also, is this only for C# client or also for all other clients including Java client? I got the same error using Java client and hence ended up on this page.
it’s actually a bug and I think they fixed it already. If you use the latest appium build from github (git clone https://github.com/appium/appium.git), the problem is fixed. And that’s what I am using.