Appium 1.5.3 Fails to launch my Android app on emulator or physical device

Stuck here and fails to install and launch the apk

Launching Appium with command: ‘/Applications/Appium.app/Contents/Resources/node/bin/node’ lib/server/main.js --command-timeout “7200” --debug-log-spacing --automation-name “Appium” --platform-name “Android” --platform-version “4.4” --app “/Users/shubhojeet.sarkar/Desktop/Mobile_Builds/Android_builds/4.0/debug/app-nightly-debug.apk”

e(Be[m
info: Welcome to Appium v1.4.13 (REV c75d8adcb66a75818a542fe1891a34260c21f76a)

info: Appium REST http interface listener started on 0.0.0.0:4723
info: [debug] Non-default server args: {“app”:"/Users/shubhojeet.sarkar/Desktop/Mobile_Builds/Android_builds/4.0/debug/app-nightly-debug.apk",“platformName”:“Android”,“platformVersion”:“4.4”,“automationName”:“Appium”,“defaultCommandTimeout”:7200,“debugLogSpacing”:true}
info: Console LogLevel: debug

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}

info: <-- GET /wd/hub/status 200 7.027 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}

info: <-- GET /wd/hub/status 200 2.310 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}

I m facing same issue.

appium version:: 1.5.3
MAC os:: 10.11.2

[TestNG] Running:
/private/var/folders/99/v_qpg_mj2zd15kd_r37m4ffh0000gp/T/testng-eclipse–2134805956/testng-customsuite.xml

FAILED CONFIGURATION: @BeforeMethod install
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. Details: Problem getting session data for driver type AndroidDriver; does it implement ‘get driverData’? (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 19 milliseconds
Build info: version: ‘2.53.0’, revision: ‘35ae25b’, time: ‘2016-03-15 17:00:58’
System info: host: ‘usermac104.local’, ip: ‘192.168.1.230’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11.2’, java.version: ‘1.8.0_91’
Driver info: io.appium.java_client.android.AndroidDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:43)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:144)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:39)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:69)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:78)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:67)
at config.setup.install(setup.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:585)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:816)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1124)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:774)
at org.testng.TestRunner.run(TestRunner.java:624)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)
at org.testng.SuiteRunner.run(SuiteRunner.java:261)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1215)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
at org.testng.TestNG.run(TestNG.java:1048)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:137)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:58)

SKIPPED CONFIGURATION: @AfterMethod teardown
SKIPPED: Fb

===============================================
Default test
Tests run: 1, Failures: 0, Skips: 1
Configuration Failures: 1, Skips: 1

===============================================
Default suite
Total tests run: 1, Failures: 0, Skips: 1
Configuration Failures: 1, Skips: 1

[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@27f674d: 17 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@7c30a502: 34 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@3f3afe78: 8 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@7e0ea639: 7 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 33 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@5b464ce8: 6 ms

I’m also unable to do anything using v1.5.3 of the GUI app on OSX. Trying to launch an app always gets the following error:
[AndroidDriver] Error: Unable to find an active device or emulator with OS 4.4. The following are available: 84B5T15A09000719 (6.0.1)

So of course I looked in the Android settings for changing the “Platform Version” … but only as late as 5.1 is in the list. We never had to have the precise Android OS version as “Platform Version” before. Why would this change?

1 Like

The same problem in my side, also got this error
[AndroidDriver] Error: Unable to find an active device or emulator with OS 4.4. The following are available: 84B5T15A09000719 (6.0.1)

1 Like

Hello Appium team,

Do we have solution or a workaround for this mew issue we are facing as described above by everyone who posted above, I am also facing the same problem on mac using new appium version 1.5.3,appium log keeps throwing error about android OS 4.4.4 although my attached device is Nexus 6P with OS 6.0.1.
What could be the reason for such kind of issue, I am not facing any such problem on my windows machine but only on mac,

Please guys any immediate solution from anyone will help us.

Thanks

I downgraded my Appium version to 1.4.16 and have continued building tests on KitKat. My tests do succeed when I run them local OR remote with this version of Appium.

I agree we need a quicker resolution for this.

I am also facing same issue, can one from Appium team help us?

You can try this:

Create your chromedriver launcher script (/usr/local/bin/chromedriver-launcher):

#!/usr/bin/env bash

# Path to chromedriver
declare -r chromedriver_executable="/usr/lib/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-chromedriver/chromedriver/linux/chromedriver_64"

# Make sure log directory exist
mkdir -p /var/log/chromedriver

# Execute chromedriver with --log-path and --verbose options for detail logs
# and --disable-build-check to skip Chrome version check 
exec "${chromedriver_executable}" "$@" --log-path=/var/log/chromedriver/chromedriver-$(date +%Y%d%m%H%M%S).log --verbose --disable-build-check

Then invoke Appium with args -chromedriver-executable /usr/local/bin/chromedriver-launcher and check the chromedriver log file(s).

Remember to adjust paths to your system.

Sorry, this is not for your issue. You may still find it helpful.

With regards to the original issue.

Appium 1.5.3 is more strict if it comes to capability matching, especially platformVersion. If you start appium with --platform-version you define default desired capability platformVersion. If you do not provide platformVersion for your session - this one will be used. Mind, you have an option not to provide platformVersion capability.

If platformVersion capability is defined Appium checks if your connected device is of that version. It is that simple. So if your Android is 6.0.1 - specify this value.

However, I do recommend not to specify platformVersion capability (or --platform-version), unless you really rely on the version.

1 Like

deviceName also seem to be made mandatory in 1.5.3

And earlier it used to run on any device connected irrespective of platform version specified in the desired capabilities. But with 1.5.3, it works only if the platform version in desired capabilities match the version of the device connected.

This definitely needs to be fixed, but I found a simple workaround for still being able to test on any Android version in the meantime.

Simply add this to your Desired Capabilities:

caps.setCapability(MobileCapabilityType.PLATFORM_VERSION, “6.0.1”);

with “caps” being the name of your Desired Capabilities, and “6.0.1” being the version that you want to test on. Hope this helps other people!

1 Like

That worked. I consistently user --pre-launch application as a test setup for my tests and that still remains broken. However, explicitly mentioning which device you are developing on via desired capabilities does help resolve this problem. You may add the platform-version as Wes mentions above ^^ or if you pass them from the UI: .

So based on recommendation of @maciekm6k to not specify --platform-version, I now just run appium 1.5.3 from the command line instead of the gui.

And it kind of looks like this:

/Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/build/lib/main.js --debug-log-spacing --automation-name “Appium” --platform-name “Android” --session-override

Hey RKY, Please let me know if you find any solution for this problem. I am in need this very badly.

Hi there. So the only thing I ever used the GUI for is to inspect a screen
and get element locators. I since switched to simply using
uiautomatorviewer (in [SDK directory]/tools) to inspect screen elements. It
won’t give you the ability to test an xpath (that I know of, but admittedly
haven’t looked too hard), but it does a way better job letting you see and
click elements on screen to know their properties.

Just a heads up that uiautomatorviewer will show a weird error if you also
have Appium server running, so you’ll want to stop that when inspecting.

Hope that helps!

Hi @vnvbsudhakar @RKY , you need to just add the platform version in your set of capabilities. Add the below command and you will be all set for your test.

caps.setCapability(“platformVersion”, “6.0”);

Abishek, I think you’re referring to the driver in code, whereas I was
referring to the OSX GUI app. Yes, I use all API levels of devices from my
code no issue; this was simply for the purposes of using the GUI to inspect
elements–not run tests. Thanks for trying to help out, though!

I have my Emulator and Device on API24 but my appium is configured for API23 so, I was facing this error. Thanks for the pointer (–platform-version).