Appium.app not found ENOENT, no such file or directory '/Applications/Appium.app/Contents/Resources/node_modules/appium/~/library/android/sdk/build-tools'

Hi all,

I am trying to set up my first appium automation project for a native android app on a physical device.

I’m working on:
OSx: 10.10.1
Appium: 1.4.0

I have set the path to my .apk, platform version, and device name and point the advanced settings to my android sdk (/library/android/sdk).

Whenever I launch appium I get the correct result.

Whenever I launch the inspector I received the following error:
error: Unhandled error: Error: ENOENT, no such file or directory '/library/android/sdk/build-tools' at Error (native) at Object.fs.readdirSync (fs.js:761:18) at exports.getDirectories (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/helpers.js:100:18) at [object Object].ADB.checkSdkBinaryPresent (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:97:25) at [object Object].ADB.checkAdbPresent (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:134:8) at Function.ADB.createADB (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:73:7) at [object Object].androidCommon.initAdb (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:1083:9) at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:607:21 at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:246:17 at iterate (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:146:13) at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:157:25 at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:248:21 at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:612:34 at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:1077:12) at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:1064:12) at ChildProcess.exithandler (child_process.js:742:7) at ChildProcess.emit (events.js:110:17) at maybeClose (child_process.js:1015:16) at Socket.<anonymous> (child_process.js:1183:11) at Socket.emit (events.js:107:17) at Pipe.close (net.js:485:12) context: [POST /wd/hub/session {"desiredCapabilities":{"platformName":"Android","platformVersion":"5.1","newCommandTimeout":"999999","automationName":"Appium","deviceName":"Nexus7"}}]

I solved this one by adding a ~to the path pointing to my android SDK.
Now it says: ~/library/android/sdk

Which results in the following error:
error: Unhandled error: Error: ENOENT, no such file or directory '/Applications/Appium.app/Contents/Resources/node_modules/appium/~/library/android/sdk/build-tools' at Error (native) at Object.fs.readdirSync (fs.js:761:18) at exports.getDirectories (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/helpers.js:100:18) at [object Object].ADB.checkSdkBinaryPresent (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:97:25) at [object Object].ADB.checkAdbPresent (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:134:8) at Function.ADB.createADB (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:73:7) at [object Object].androidCommon.initAdb (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:1083:9) at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:607:21 at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:246:17 at iterate (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:146:13) at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:157:25 at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:248:21 at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:612:34 at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:1077:12) at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:1064:12) at ChildProcess.exithandler (child_process.js:742:7) at ChildProcess.emit (events.js:110:17) at maybeClose (child_process.js:1015:16) at Socket.<anonymous> (child_process.js:1183:11) at Socket.emit (events.js:107:17) at Pipe.close (net.js:485:12) context: [POST /wd/hub/session {"desiredCapabilities":{"platformName":"Android","platformVersion":"5.1","newCommandTimeout":"999999","automationName":"Appium","deviceName":"Nexus7"}}]

It seems as if it can’t find the appium app as the real path to the appium app is: ~/applications/appium.app

Any help is greatly appreciated!

@Jefc There is an issue with your Android SDK. Update SDK if required and set environment variables.

It seemed that moving the android folder containing the SDK to /library instead of ~/library/android solved something.

However, I now receive the following error:

error: Failed to start an Appium session, err was: Error: Could not find aapt in tools, platform-tools, or supported build-tools under "/library/android/sdk"; do you have the Android SDK installed at this location?

I checked and aapt is in the following location /library/android/sdk/build-tools.