Appium is not working for android

Hi All, please find the logs and its always asking me to set the path of the ANDROID_HOME though i set it. Even i verified in appium-doctor too

2020-01-09 17:08:47:472 [Appium] Welcome to Appium v1.16.0
2020-01-09 17:08:47:473 [Appium] Non-default server args:
2020-01-09 17:08:47:474 [Appium] address: 127.0.0.1
2020-01-09 17:08:47:474 [Appium] port: 4725
2020-01-09 17:08:47:474 [Appium] sessionOverride: true
2020-01-09 17:08:47:475 [Appium] logFile: /Users/aa892475/AppiumServerLogs.txt
2020-01-09 17:08:47:505 [Appium] Appium REST http interface listener started on 127.0.0.1:4725
2020-01-09 17:08:47:799 [HTTP] --> GET /wd/hub/status
2020-01-09 17:08:47:800 [HTTP] {}
2020-01-09 17:08:47:801 [GENERIC] Calling AppiumDriver.getStatus() with args: []
2020-01-09 17:08:47:802 [GENERIC] Responding to client with driver.getStatus() result: {“build”:{“version”:“1.16.0”}}
2020-01-09 17:08:47:806 [HTTP] <-- GET /wd/hub/status 200 5 ms - 68
2020-01-09 17:08:47:806 [HTTP]
2020-01-09 17:08:48:236 [HTTP] --> POST /wd/hub/session
2020-01-09 17:08:48:236 [HTTP] {“desiredCapabilities”:{“app”:"/Users/aa892475/Documents/CCIMobilelUITest/src/test/resources/app-release.apk",“rotatable”:true,“clearSystemFiles”:true,“apppackage”:“com.aa.dev.AmericanAirlines”,“deviceName”:“Android”,“fullReset”:true,“newCommandTimeout”:“200”,“automationName”:“UiAutomator2”,“autoGrantPermissions”:“true”,“takesScreenshot”:true,“eventTimings”:true,“platformName”:“Android”,“cssSelectorsEnabled”:true},“capabilities”:{“firstMatch”:[{“appium:app”:"/Users/aa892475/Documents/CCIMobilelUITest/src/test/resources/app-release.apk",“apppackage”:“com.aa.dev.AmericanAirlines”,“appium:autoGrantPermissions”:“true”,“appium:automationName”:“UiAutomator2”,“appium:clearSystemFiles”:true,“cssSelectorsEnabled”:true,“appium:deviceName”:“Android”,“appium:eventTimings”:true,“appium:fullReset”:true,“appium:newCommandTimeout”:“200”,“platformName”:“android”,“rotatable”:true,“takesScreenshot”:true}]}}
2020-01-09 17:08:48:237 [W3C] Calling AppiumDriver.createSession() with args: [{“app”:"/Users/aa892475/Documents/CCIMobilelUITest/src/test/resources/app-release.apk",“rotatable”:true,“clearSystemFiles”:true,“apppackage”:“com.aa.dev.AmericanAirlines”,“deviceName”:“Android”,“fullReset”:true,“newCommandTimeout”:“200”,“automationName”:“UiAutomator2”,“autoGrantPermissions”:“true”,“takesScreenshot”:true,“eventTimings”:true,“platformName”:“Android”,“cssSelectorsEnabled”:true},null,{“firstMatch”:[{“appium:app”:"/Users/aa892475/Documents/CCIMobilelUITest/src/test/resources/app-release.apk",“apppackage”:“com.aa.dev.AmericanAirlines”,“appium:autoGrantPermissions”:“true”,“appium:automationName”:“UiAutomator2”,“appium:clearSystemFiles”:true,“cssSelectorsEnabled”:true,“appium:deviceName”:“Android”,“appium:eventTimings”:true,“appium:fullReset”:true,“appium:newCommandTimeout”:“200”,“platformName”:“android”,“rotatable”:true,“takesScreenshot”:true}]}]
2020-01-09 17:08:48:237 [BaseDriver] Event ‘newSessionRequested’ logged at 1578589728237 (11:08:48 GMT-0600 (Central Standard Time))
2020-01-09 17:08:48:240 [BaseDriver] The capabilities [“apppackage”,“cssSelectorsEnabled”,“rotatable”,“takesScreenshot”] are not standard capabilities and should have an extension prefix
2020-01-09 17:08:48:242 [BaseDriver] Number capability passed in as string. Functionality may be compromised.
2020-01-09 17:08:48:545 [Appium] Appium v1.16.0 creating new AndroidUiautomator2Driver (v1.40.0) session
2020-01-09 17:08:48:547 [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
2020-01-09 17:08:48:547 [BaseDriver] Creating session with W3C capabilities: {
2020-01-09 17:08:48:547 [BaseDriver] “alwaysMatch”: {
2020-01-09 17:08:48:547 [BaseDriver] “appium:apppackage”: “com.aa.dev.AmericanAirlines”,
2020-01-09 17:08:48:547 [BaseDriver] “appium:cssSelectorsEnabled”: true,
2020-01-09 17:08:48:548 [BaseDriver] “platformName”: “android”,
2020-01-09 17:08:48:548 [BaseDriver] “appium:rotatable”: true,
2020-01-09 17:08:48:548 [BaseDriver] “appium:takesScreenshot”: true,
2020-01-09 17:08:48:548 [BaseDriver] “appium:app”: “/Users/aa892475/Documents/CCIMobilelUITest/src/test/resources/app-release.apk”,
2020-01-09 17:08:48:548 [BaseDriver] “appium:autoGrantPermissions”: “true”,
2020-01-09 17:08:48:548 [BaseDriver] “appium:automationName”: “UiAutomator2”,
2020-01-09 17:08:48:549 [BaseDriver] “appium:clearSystemFiles”: true,
2020-01-09 17:08:48:549 [BaseDriver] “appium:deviceName”: “Android”,
2020-01-09 17:08:48:549 [BaseDriver] “appium:eventTimings”: true,
2020-01-09 17:08:48:549 [BaseDriver] “appium:fullReset”: true,
2020-01-09 17:08:48:549 [BaseDriver] “appium:newCommandTimeout”: “200”
2020-01-09 17:08:48:549 [BaseDriver] },
2020-01-09 17:08:48:550 [BaseDriver] “firstMatch”: [
2020-01-09 17:08:48:550 [BaseDriver] {}
2020-01-09 17:08:48:550 [BaseDriver] ]
2020-01-09 17:08:48:550 [BaseDriver] }
2020-01-09 17:08:48:551 [BaseDriver] Number capability passed in as string. Functionality may be compromised.
2020-01-09 17:08:48:553 [BaseDriver] Capability ‘autoGrantPermissions’ changed from string to boolean. This may cause unexpected behavior
2020-01-09 17:08:48:553 [BaseDriver] Capability ‘newCommandTimeout’ changed from string (‘200’) to integer (200). This may cause unexpected behavior
2020-01-09 17:08:48:556 [BaseDriver] The following capabilities were provided, but are not recognized by Appium:
2020-01-09 17:08:48:556 [BaseDriver] apppackage
2020-01-09 17:08:48:556 [BaseDriver] cssSelectorsEnabled
2020-01-09 17:08:48:556 [BaseDriver] rotatable
2020-01-09 17:08:48:557 [BaseDriver] takesScreenshot
2020-01-09 17:08:48:557 [BaseDriver] Session created with session id: 2c196c4a-e953-43c1-8585-8c1f53c4a16f
2020-01-09 17:08:48:559 [BaseDriver] Using local app ‘/Users/aa892475/Documents/CCIMobilelUITest/src/test/resources/app-release.apk’
2020-01-09 17:08:48:559 [UiAutomator2] Checking whether app is actually present
2020-01-09 17:08:48:560 [ADB] The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for adb.
2020-01-09 17:08:48:563 [UiAutomator2] Deleting UiAutomator2 session
2020-01-09 17:08:48:563 [BaseDriver] Event ‘newSessionStarted’ logged at 1578589728563 (11:08:48 GMT-0600 (Central Standard Time))
2020-01-09 17:08:48:588 [W3C] Encountered internal error running command: Error: Could not find ‘adb’ in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the correct Android SDK root directory path.
2020-01-09 17:08:48:588 [W3C] at ADB.getBinaryFromPath (/usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/tools/system-calls.js:135:11)
2020-01-09 17:08:48:617 [HTTP] <-- POST /wd/hub/session 500 380 ms - 791
2020-01-09 17:08:48:617 [HTTP]

Not much information in your post, so I’ll hazard an educated guess that you are using an IDE that is not set to use your Environment Variables. My second educated guess (because this is probably one of the most repeated questions on this forum) is that you are using Eclipse:

Most likely scenario you’re running your tests from an IDE. Set your environment variables in the ~/.bash_profile file instead of the ~/.bashrc file, then log out and back in.

I configured in .bash_profile but not in IDE. Appium-doctor is giving success

I’m sorry, I meant the file .profile, not .bash_profile. Also, set the corresponding paths in your PATH environment variable, like this:

export ANDROID_HOME=/home/cesarv/Android/Sdk
export PATH=${ANDROID_HOME}/tools:${PATH}
export PATH=${ANDROID_HOME}/platform-tools:${PATH}
export PATH=${ANDROID_HOME}/build-tools/29.0.2:${PATH}

Log out and back in.

P.D.: check the version of your build tools and change it accordingly.

Hi , I have done what you have told and please find the logs below: The issue is the same :slightly_frowning_face:

Jan 10, 2020 10:22:16 AM cucumber.api.cli.Main run
WARNING: You are using deprecated Main class. Please use io.cucumber.core.cli.Main
Feature: Title of your feature
AS a user i want to verify login page attributes and verify login function is working

Scenario: Verifying login page attributes and verifying login functionality flow # /Users/aa892475/Documents/CCIMobilelUITest/src/test/resources/features/login.feature:4

true
4725
SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
e[35m[Appium]e[39m Welcome to Appium v1.14.0
e[35m[Appium]e[39m Non-default server args:
e[35m[Appium]e[39m address: 127.0.0.1
e[35m[Appium]e[39m port: 4725
e[35m[Appium]e[39m sessionOverride: true
e[35m[Appium]e[39m logFile: /Users/aa892475/AppiumServerLogs.txt
e[35m[Appium]e[39m Appium REST http interface listener started on 127.0.0.1:4725
e[35m[HTTP]e[39m e[37m–>e[39m e[37mGETe[39m e[37m/wd/hub/statuse[39m
e[35m[HTTP]e[39m e[90m{}e[39m
[debug] e[35m[GENERIC]e[39m Calling AppiumDriver.getStatus() with args: []
[debug] e[35m[GENERIC]e[39m Responding to client with driver.getStatus() result: {“build”:{“version”:“1.14.0”}}
e[35m[HTTP]e[39m e[37m<-- GET /wd/hub/status e[39me[32m200e[39m e[90m5 ms - 68e[39m
e[35m[HTTP]e[39m e[90me[39m
e[35m[HTTP]e[39m e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/sessione[39m
e[35m[HTTP]e[39m e[90m{“desiredCapabilities”:{“app”:"/Users/aa892475/Documents/CCIMobilelUITest/src/test/resources/app-release.apk",“rotatable”:true,“clearSystemFiles”:true,“apppackage”:“com.aa.dev.AmericanAirlines”,“deviceName”:“Android”,“fullReset”:true,“newCommandTimeout”:“200”,“automationName”:“UiAutomator2”,“autoGrantPermissions”:“true”,“takesScreenshot”:true,“eventTimings”:true,“platformName”:“Android”,“cssSelectorsEnabled”:true},“capabilities”:{“firstMatch”:[{“appium:app”:"/Users/aa892475/Documents/CCIMobilelUITest/src/test/resources/app-release.apk",“apppackage”:“com.aa.dev.AmericanAirlines”,“appium:autoGrantPermissions”:“true”,“appium:automationName”:“UiAutomator2”,“appium:clearSystemFiles”:true,“cssSelectorsEnabled”:true,“appium:deviceName”:“Android”,“appium:eventTimings”:true,“appium:fullReset”:true,“appium:newCommandTimeout”:“200”,“platformName”:“android”,“rotatable”:true,“takesScreenshot”:true}]}}e[39m
[debug] e[35m[W3C]e[39m Calling AppiumDriver.createSession() with args: [{“app”:"/Users/aa892475/Documents/CCIMobilelUITest/src/test/resources/app-release.apk",“rotatable”:true,“clearSystemFiles”:true,“apppackage”:“com.aa.dev.AmericanAirlines”,“deviceName”:“Android”,“fullReset”:true,“newCommandTimeout”:“200”,“automationName”:“UiAutomator2”,“autoGrantPermissions”:“true”,“takesScreenshot”:true,“eventTimings”:true,“platformName”:“Android”,“cssSelectorsEnabled”:true},null,{“firstMatch”:[{“appium:app”:"/Users/aa892475/Documents/CCIMobilelUITest/src/test/resources/app-release.apk",“apppackage”:“com.aa.dev.AmericanAirlines”,“appium:autoGrantPermissions”:“true”,“appium:automationName”:“UiAutomator2”,“appium:clearSystemFiles”:true,“cssSelectorsEnabled”:true,“appium:deviceName”:“Android”,“appium:eventTimings”:true,“appium:fullReset”:true,“appium:newCommandTimeout”:“200”,“platformName”:“android”,“rotatable”:true,“takesScreenshot”:true}]}]
[debug] e[35m[BaseDriver]e[39m Event ‘newSessionRequested’ logged at 1578673337870 (10:22:17 GMT-0600 (Central Standard Time))
e[35m[BaseDriver]e[39m The capabilities [“apppackage”,“cssSelectorsEnabled”,“rotatable”,“takesScreenshot”] are not standard capabilities and should have an extension prefix
e[35m[BaseDriver]e[39m Number capability passed in as string. Functionality may be compromised.
e[35m[Appium]e[39m Appium v1.14.0 creating new AndroidUiautomator2Driver (v1.33.1) session
e[35m[Appium]e[39m Capabilities:
e[35m[Appium]e[39m apppackage: com.aa.dev.AmericanAirlines
e[35m[Appium]e[39m cssSelectorsEnabled: true
e[35m[Appium]e[39m platformName: android
e[35m[Appium]e[39m rotatable: true
e[35m[Appium]e[39m takesScreenshot: true
e[35m[Appium]e[39m app: /Users/aa892475/Documents/CCIMobilelUITest/src/test/resources/app-release.apk
e[35m[Appium]e[39m autoGrantPermissions: true
e[35m[Appium]e[39m automationName: UiAutomator2
e[35m[Appium]e[39m clearSystemFiles: true
e[35m[Appium]e[39m deviceName: Android
e[35m[Appium]e[39m eventTimings: true
e[35m[Appium]e[39m fullReset: true
e[35m[Appium]e[39m newCommandTimeout: 200
[debug] e[35m[BaseDriver]e[39m W3C capabilities {“alwaysMatch”:{“appium:app… and MJSONWP desired capabilities {“app”:”/Users/aa892475/Doc… were provided
[debug] e[35m[BaseDriver]e[39m Creating session with W3C capabilities: {“alwaysMatch”:{"appium:app…
e[35m[BaseDriver]e[39m Number capability passed in as string. Functionality may be compromised.
e[35m[BaseDriver]e[39m Capability ‘autoGrantPermissions’ changed from string to boolean. This may cause unexpected behavior
e[35m[BaseDriver]e[39m Capability ‘newCommandTimeout’ changed from string (‘200’) to integer (200). This may cause unexpected behavior
e[35m[BaseDriver]e[39m The following capabilities were provided, but are not recognized by Appium:
e[35m[BaseDriver]e[39m apppackage
e[35m[BaseDriver]e[39m cssSelectorsEnabled
e[35m[BaseDriver]e[39m rotatable
e[35m[BaseDriver]e[39m takesScreenshot
e[35m[BaseDriver]e[39m Session created with session id: 2f1ce690-7b20-445a-a8a5-2deb973e2b2d
e[35m[BaseDriver]e[39m Using local app ‘/Users/aa892475/Documents/CCIMobilelUITest/src/test/resources/app-release.apk’
[debug] e[35m[UiAutomator2]e[39m Checking whether app is actually present
e[35m[ADB]e[39m The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for adb.
[debug] e[35m[UiAutomator2]e[39m Deleting UiAutomator2 session
[debug] e[35m[BaseDriver]e[39m Event ‘newSessionStarted’ logged at 1578673338119 (10:22:18 GMT-0600 (Central Standard Time))
[debug] e[35m[W3C]e[39m Encountered internal error running command: Error: Could not find ‘adb’ in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the corect Android SDK root directory path.
[debug] e[35m[W3C]e[39m at ADB.getBinaryFromPath (/usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/tools/system-calls.js:135:11)
e[35m[HTTP]e[39m e[37m<-- POST /wd/hub/session e[39me[31m500e[39m e[90m286 ms - 789e[39m
e[35m[HTTP]e[39m e[90me[39m
org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Could not find ‘adb’ in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the corect Android SDK root directory path.
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘magentis-mbp.corpaa.aa.com’, ip: ‘fe80:0:0:0:14af:415a:99af:f613%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.14.6’, java.version: ‘1.8.0_231’
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not find ‘adb’ in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the corect Android SDK root directory path.
at getResponseForW3CError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:826:9)
at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:447:37)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘magentis-mbp.corpaa.aa.com’, ip: ‘fe80:0:0:0:14af:415a:99af:f613%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.14.6’, java.version: ‘1.8.0_231’
Driver info: driver.version: AndroidDriver
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:208)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:41)
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:213)
at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:336)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:37)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:88)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:98)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:94)
at com.aa.cci.utils.DriverProvider.createAndroidDriver(DriverProvider.java:103)
at com.aa.cci.utils.DriverProvider.createMobileDriver(DriverProvider.java:68)
at com.aa.cci.utils.DriverProvider.(DriverProvider.java:58)
at com.aa.cci.pages.LoginPage.mobileCCIIsOpened(LoginPage.java:27)
at com.aa.cci.steps.LoginSteps.mobile_cci_app_is_opened(LoginSteps.java:14)
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 cucumber.runtime.Utils$1.call(Utils.java:26)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:20)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:57)
at cucumber.runner.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:50)
at cucumber.runner.TestStep.executeStep(TestStep.java:65)
at cucumber.runner.TestStep.run(TestStep.java:50)
at cucumber.runner.PickleStepTestStep.run(PickleStepTestStep.java:43)
at cucumber.runner.TestCase.run(TestCase.java:46)
at cucumber.runner.Runner.runPickle(Runner.java:50)
at cucumber.runtime.Runtime$1.run(Runtime.java:104)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at cucumber.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:258)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at cucumber.runtime.Runtime.run(Runtime.java:101)
at io.cucumber.core.cli.Main.run(Main.java:43)
at cucumber.api.cli.Main.run(Main.java:28)
at cucumber.api.cli.Main.main(Main.java:15)
Caused by: java.lang.reflect.InvocationTargetException
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 io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:186)
… 41 more
Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not find ‘adb’ in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the corect Android SDK root directory path.
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘magentis-mbp.corpaa.aa.com’, ip: ‘fe80:0:0:0:14af:415a:99af:f613%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.14.6’, java.version: ‘1.8.0_231’
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not find ‘adb’ in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the corect Android SDK root directory path.
at getResponseForW3CError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:826:9)
at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:447:37)
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.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62)
at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:499)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:486)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
… 46 more
Given mobile cci app is opened # LoginSteps.mobile_cci_app_is_opened()
java.lang.AssertionError: Failed to create mobile driver Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Could not find ‘adb’ in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the corect Android SDK root directory path.
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘magentis-mbp.corpaa.aa.com’, ip: ‘fe80:0:0:0:14af:415a:99af:f613%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.14.6’, java.version: ‘1.8.0_231’
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not find ‘adb’ in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the corect Android SDK root directory path.
at getResponseForW3CError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:826:9)
at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:447:37)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘magentis-mbp.corpaa.aa.com’, ip: ‘fe80:0:0:0:14af:415a:99af:f613%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.14.6’, java.version: ‘1.8.0_231’
Driver info: driver.version: AndroidDriver
at org.testng.Assert.fail(Assert.java:97)
at com.aa.cci.utils.DriverProvider.(DriverProvider.java:61)
at com.aa.cci.pages.LoginPage.mobileCCIIsOpened(LoginPage.java:27)
at com.aa.cci.steps.LoginSteps.mobile_cci_app_is_opened(LoginSteps.java:14)
at ✽.mobile cci app is opened(file:/Users/aa892475/Documents/CCIMobilelUITest/src/test/resources/features/login.feature:5)

Then I verify that American Airlines text is displayed                                                                            # LoginSteps.i_verify_that_American_Airlines_text_is_displayed()
And I verify the text mobileCCI is displayed                                                                                      # LoginSteps.i_verify_the_text_mobileCCI_is_displayed()
And I verify that Remember Me text is displayed                                                                                   # LoginSteps.i_verify_that_Remember_Me_text_is_displayed()
And I verify that Remember me check box is in Off mode                                                                            # LoginSteps.i_verify_that_Remember_me_check_box_is_in_Off_mode()
When I enter the AA ID                                                                                                            # LoginSteps.i_enter_the_AA_ID()
And I enter the AA password                                                                                                       # LoginSteps.i_enter_the_AA_password()
And I click Login button                                                                                                          # LoginSteps.i_click_Login_button()
Then I verify that pin screen is displayed with text mobileCCI, welcome to mobileCCI, Please create a 4 digit PIN and other texts # LoginSteps.i_verify_that_pin_screen_is_displayed_with_text_mobileCCI_welcome_to_mobileCCI_Please_create_a_digit_PIN_and_other_texts(Integer)
When I enter the pin number                                                                                                       # LoginSteps.i_enter_the_pin_number()
Then I verify that confirm pin screen is displayed                                                                                # LoginSteps.i_verify_that_confirm_pin_screen_is_displayed()
When I re-enter the confirmation pin number                                                                                       # LoginSteps.i_re_enter_the_confirmation_pin_number()
Then I verify that Home page is dispalyed                                                                                         # LoginSteps.i_verify_that_Home_page_is_dispalyed()
When I click on Settings button                                                                                                   # LoginSteps.i_click_on_Settings_button()
And I click logout                                                                                                                # LoginSteps.i_click_logout()
Then I verify Logout Warning dialog box is displayed                                                                              # LoginSteps.i_verify_Logout_Warning_dialog_box_is_displayed()
When I click Logout button in modal                                                                                               # LoginSteps.i_click_Logout_button_in_modal()
Then I verify that login page is displayed                                                                                        # LoginSteps.i_verify_that_login_page_is_displayed()

Failed scenarios:
/Users/aa892475/Documents/CCIMobilelUITest/src/test/resources/features/login.feature:4 # Verifying login page attributes and verifying login functionality flow

1 Scenarios (1 failed)
18 Steps (1 failed, 17 skipped)
0m1.539s

java.lang.AssertionError: Failed to create mobile driver Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Could not find ‘adb’ in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the corect Android SDK root directory path.
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘magentis-mbp.corpaa.aa.com’, ip: ‘fe80:0:0:0:14af:415a:99af:f613%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.14.6’, java.version: ‘1.8.0_231’
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not find ‘adb’ in PATH. Please set the ANDROID_HOME or ANDROID_SDK_ROOT environment variables to the corect Android SDK root directory path.
at getResponseForW3CError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:826:9)
at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:447:37)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘magentis-mbp.corpaa.aa.com’, ip: ‘fe80:0:0:0:14af:415a:99af:f613%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.14.6’, java.version: ‘1.8.0_231’
Driver info: driver.version: AndroidDriver
at org.testng.Assert.fail(Assert.java:97)
at com.aa.cci.utils.DriverProvider.(DriverProvider.java:61)
at com.aa.cci.pages.LoginPage.mobileCCIIsOpened(LoginPage.java:27)
at com.aa.cci.steps.LoginSteps.mobile_cci_app_is_opened(LoginSteps.java:14)
at ✽.mobile cci app is opened(file:/Users/aa892475/Documents/CCIMobilelUITest/src/test/resources/features/login.feature:5)

Appium-doctor result:
Last login: Fri Jan 10 10:19:59 on ttys000

magentis-mbp:~ aa892475$ appium-doctor

info AppiumDoctor Appium Doctor v.1.13.0

info AppiumDoctor ### Diagnostic for necessary dependencies starting ###

info AppiumDoctor :heavy_check_mark: The Node.js binary was found at: /usr/local/bin/node

info AppiumDoctor :heavy_check_mark: Node version is 12.12.0

WARN AppiumDoctor :heavy_multiplication_x: Xcode is NOT installed!

info AppiumDoctor :heavy_check_mark: Xcode Command Line Tools are installed in: /Library/Developer/CommandLineTools

info AppiumDoctor :heavy_check_mark: DevToolsSecurity is enabled.

info AppiumDoctor :heavy_check_mark: The Authorization DB is set up properly.

WARN AppiumDoctor :heavy_multiplication_x: Carthage was NOT found!

info AppiumDoctor :heavy_check_mark: HOME is set to: /Users/aa892475

info AppiumDoctor :heavy_check_mark: ANDROID_HOME is set to: /Users/aa892475/Library/Android/sdk

info AppiumDoctor :heavy_check_mark: JAVA_HOME is set to: /Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home

info AppiumDoctor :heavy_check_mark: adb exists at: /Users/aa892475/Library/Android/sdk/platform-tools/adb

info AppiumDoctor :heavy_check_mark: android exists at: /Users/aa892475/Library/Android/sdk/tools/android

info AppiumDoctor :heavy_check_mark: emulator exists at: /Users/aa892475/Library/Android/sdk/tools/emulator

info AppiumDoctor :heavy_check_mark: Bin directory of $JAVA_HOME is set

info AppiumDoctor ### Diagnostic for necessary dependencies completed, 2 fixes needed. ###

info AppiumDoctor

info AppiumDoctor ### Diagnostic for optional dependencies starting ###

WARN AppiumDoctor :heavy_multiplication_x: opencv4nodejs cannot be found.

WARN AppiumDoctor :heavy_multiplication_x: ffmpeg cannot be found

WARN AppiumDoctor :heavy_multiplication_x: mjpeg-consumer cannot be found.

WARN AppiumDoctor :heavy_multiplication_x: set-simulator-location is not installed

WARN AppiumDoctor :heavy_multiplication_x: idb and idb_companion are not installed

WARN AppiumDoctor :heavy_multiplication_x: applesimutils cannot be found

WARN AppiumDoctor :heavy_multiplication_x: ios-deploy cannot be found

WARN AppiumDoctor :heavy_multiplication_x: bundletool.jar cannot be found

info AppiumDoctor ### Diagnostic for optional dependencies completed, 8 fixes possible. ###

info AppiumDoctor

info AppiumDoctor ### Manual Fixes Needed ###

info AppiumDoctor The configuration cannot be automatically fixed, please do the following first:

WARN AppiumDoctor ➜ Manually install Xcode , and make sure ‘xcode-select -p’ command shows proper path like ‘/Applications/Xcode.app/Contents/Developer’

WARN AppiumDoctor ➜ Please install Carthage . Visit https://github.com/Carthage/Carthage#installing-carthage for more information.

info AppiumDoctor

info AppiumDoctor ### Optional Manual Fixes ###

info AppiumDoctor The configuration can install optionally. Please do the following manually:

WARN AppiumDoctor ➜ Why opencv4nodejs is needed and how to install it: https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/image-comparison.md

WARN AppiumDoctor ➜ ffmpeg is needed to record screen features. Please read https://www.ffmpeg.org/ to install it

WARN AppiumDoctor ➜ mjpeg-consumer module is required to use MJPEG-over-HTTP features. Please install it with ‘npm i -g mjpeg-consumer’.

WARN AppiumDoctor ➜ set-simulator-location is needed to set location for Simulator. Please real https://github.com/lyft/set-simulator-location to install it

WARN AppiumDoctor ➜ Why idb is needed and how to install it: https://github.com/appium/appium-idb

WARN AppiumDoctor ➜ Why applesimutils is needed and how to install it: http://appium.io/docs/en/drivers/ios-xcuitest/

WARN AppiumDoctor ➜ ios-deploy is used as a fallback command to install iOS applications to real device. Please read https://github.com/ios-control/ios-deploy/ to install it

WARN AppiumDoctor ➜ bundletool.jar is used to handle Android App Bundle. Please read http://appium.io/docs/en/writing-running-appium/android/android-appbundle/ to install it

info AppiumDoctor

info AppiumDoctor ###

info AppiumDoctor

info AppiumDoctor Bye! Run appium-doctor again when all manual fixes have been applied!

info AppiumDoctor

How exactly did you install node.js and appium? This path in the error message doesn’t make sense:

/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js

Using npm install -g appium and node downloaded from node.js

Did you install node.js manually or run an installer?

Also, I noted from the log you pasted here that you’re using macOS. If you’re actually using macOS, use the file .bash_profile; if you’re using Linux, use the file .profile.

I have added path in .bash_profile only.appium-doctor is working fine. Even i have added Android_Home to .profile and i can see that sdk install and uiautomatorviewer are also working from command line.

How exactly did you install node.js? Manually, or using an installer?

I installed it manually.

If you installed it manually then you must have downloaded the compressed tarball and extracted the files to a target directory you created in /usr/local/lib. Is this what you did? Check the owner and rights of the directory and if the same propagated to the subdirectories.

I have installed Appium Desktop and i can able to launch the application without any issue in it. So there must be problem in eclipse .

As you created a new topic for this issue, I will be responding on that one instead of here.

why don’t you just try IDEA to code

That won’t solve his issue.

Guys I have solved the issue. The solution is give ANDROID_PATH and JAVA_PATH in eclipse

Keep in mind that this is not an issue in Eclipse, and if you eventually run your tests from the command line, you’ll very likely run into this error again.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=509628