Getting error when running appium in Windows

Starting Node Server
warn: Appium support for versions of node < 0.12 has been deprecated and will be removed in a future version. Please upgrade!
info: Welcome to Appium v1.4.0 (REV 8f63e2f91ef7907aed8bda763f4e5ca08e86970a)
info: Appium REST http interface listener started on 127.0.0.1:5001
info: [debug] Non-default server args: {“address”:“127.0.0.1”,“port”:5001,“fullReset”:true,“logNoColors”:true,“platformName”:“Android”,“platformVersion”:“17”,“automationName”:“Appium”}
info: Console LogLevel: debug
info: --> POST /wd/hub/session {“desiredCapabilities”:{“app”:“E:\AndroidApps\ContactManager.apk”,“platformVersion”:“4.2.2”,“platformName”:“Android”,“deviceName”:“AND”,“browserName”:"",“app-package”:“com.example.android.contactmanager””,“app-activity”:“ContactManager””,“device ID”:“emulator-5554”}}
info: Client User-Agent string: Apache-HttpClient/4.4.1 (Java/1.7.0_79)
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : app-package, app-activity, device ID
info: [debug] No appActivity desired capability or server param. Parsing from apk.
info: [debug] No appPackage desired capability or server param. Parsing from apk.
info: [debug] Using local app from desired caps: E:\AndroidApps\ContactManager.apk
info: [debug] Creating new appium session 3122b4cc-c547-4773-aa3f-105e1fff7b64
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.7.0_79
info: [debug] Checking whether adb is present
warn: 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.
info: [debug] executing cmd: where adb
info: [debug] Using adb from C:\Users\Prashand\android-sdks\platform-tools\adb.exe

info: [debug] Parsing package and activity from app manifest
info: [debug] Checking whether aapt is present
warn: 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 aapt.
info: [debug] executing cmd: where aapt
error: Problem parsing package and activity from manifest: Error: Could not find aapt. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.
info: [debug] Cleaning up android objects
error: Failed to start an Appium session, err was: Error: Could not find aapt. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.
info: [debug] Cleaning up appium session
info: [debug] Error: Could not find aapt. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.
at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:126:12)
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess.handle.onexit (childprocess.js:810:5)
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Could not find aapt. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.)”,“origValue”:“Could not find aapt. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.”},“sessionId”:null}
info: <-- POST /wd/hub/session 500 329.138 ms - 344
But I already Set The path in environment variables, But it still showing the issue . Please help.

1 Like

Try to run Appium doctor:
Open your command prompt, go to your C:\Program Files (x86)\Appium\node_modules.bin directory (or equivalent) and execute command appium-doctor. You could double-click the .bat file directly, but it would just run and vanish before you can read anything.

1 Like

Please chek your “ANDROID_HOME environment variable”
because it clearly say cant find aapt.There for this might be an issue with your environmental variables
o

1 Like