Hi,
I'm using Appium with Android ( 4.4 ) and I'm facing to an issue when I try to start an Appium Inspector directly through Appium or even by code when I try to create new AndroidDriver instance.
1/ When I try to click on Appium Inspector I get this error:
In my Appium console:
error: Failed to start an Appium session, err was: Error: packageAndLaunchActivityFromManifest failed. Error: Command failed: /bin/sh -c "/Users/me/Documents/Android SDK/sdk/build-tools/android-4.4W/aapt" dump badging /Users/me/Projects/myProject/app/build/outputs/apk/app-app-debug.apk
W/ResourceType( 8096): Failure getting entry for 0x7f060020 (t=5 e=32) in package 0 (error -84)
ERROR getting 'android:label' attribute: attribute is not a string value
2/ By code I get this error:
A new session could not be created. (Original error: packageAndLaunchActivityFromManifest failed. Error: Command failed: /bin/sh -c "/Users/me/Documents/Android SDK/sdk/build-tools/android-4.4W/aapt" dump badging /Users/me/Projects/myProject/app/build/outputs/apk/app-app-debug.apk
W/ResourceType( 6918): Failure getting entry for 0x7f060020 (t=5 e=32) in package 0 (error -84)
ERROR getting 'android:label' attribute: attribute is not a string value
) (WARNING: The server did not provide any stacktrace information)
So here in my Manifest file, I tried to change my android:label=@string/name to android:label="Name" and also clean my project. But I still get this error.
My code to create Appium Driver:
protected static String directory = "/Users/me/Projects/myProject/app/build/outputs/apk";
protected static String apk = "app-app-debug.apk";
protected static AndroidDriver driver;
protected static void appiumDriver() throws MalformedURLException {
File appDir = new File(directory);
File app = new File(appDir, apk);
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("appium-version", "1.4");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("platformVersion", "4.4");
capabilities.setCapability("deviceName", "192.168.57.101:5555");
capabilities.setCapability("appPackage", "com.my.package");
capabilities.setCapability("app", app.getAbsolutePath());
//capabilities.setCapability("appWaitActivity", "10000");
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);// Error triggered at this line
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
}
Finally my settings in Appium:
I used Appium few months ago with this configuration and it was working good so I don't really see here my mistake.
Thanks for any help.