Summary:
I’m getting the error Encountered internal error running command: Error: ENOENT: dos such file or directory, scandir ‘/User/[UserName]/Library/Android/sdk/build-tools’
I’m attempting to execute a Android test from a XML document within my Eclipse solution when I get the above error.
This same test ran successfully when I executed it directly from Eclipse.
Logs
[BaseDriver] Capability ‘unicodeKeyboard’ changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Session created with session id: 926e6343-3510-4552-b7c1-5c1f92c1cbf4
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.7.0_79
[ADB] Checking whether adb is present
[debug] [AndroidDriver] Shutting down Android driver
[AndroidDriver] Cannot shut down Android driver; it has already shut down
[MJSONWP] Encountered internal error running command: Error: ENOENT: no such file or directory, scandir ‘/User/darinduphorn/Library/Android/sdk/build-tools’
at Error (native)
[HTTP] <-- POST /wd/hub/session 500 105 ms - 232
It appears that it’s looking for build-tools in the wrong directory.
I’m guessing it should be looking in /Users instead of /User
[MJSONWP] Encountered internal error running command: Error: ENOENT: no such file or directory, scandir ‘/User/[UserName]/Library/Android/sdk/build-tools’
at Error (native)
In this case, you might also want to check how you’re setting up your ANDROID_HOME environment variable. It might reference the wrong directory as well.
In my case, the environment variable was,
ANDROID_HOME=:\Users…\AppData\Local\Android\Sdk
Obviously c: missing. Appium could not locate build-tools directory.
I changed ANDROID_HOME to c:\Users…\AppData\Local\Android\Sdk
It worked fine.
I can not believe, I configured it wrong.
Did some software install mess it up?
Hello, I have a similar problem when running my test in JAVA on MAC.
As for my log, it looks like follow:
[Appium] Creating new AndroidDriver (v1.17.1) session
[Appium] Capabilities:
[Appium] app: ‘/Users/david/Eclipse-workspace/UdemyTesting/src/ApiDemos-debug.apk’
[Appium] platformName: ‘Android’
[Appium] deviceName: ‘Nexus5’
[AndroidDriver] AndroidDriver version: 1.17.1
[BaseDriver] Session created with session id: 6b42d544-8068-40b2-8cb4-429d37458e6d
[AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_131
[ADB] Checking whether adb is present
[AndroidDriver] Shutting down Android driver
[AndroidDriver] Called deleteSession but bootstrap wasn’t active
[MJSONWP] Encountered internal error running command: Error: ENOENT: no such file or directory, scandir ‘/Users/username/Library/Android/sdk/build-tools’
at Error (native)
[HTTP] <-- POST /wd/hub/session 500 123 ms - 229
I am facing similar issue
I am using Android studio, robot framework, pycharm and Appium server app
This setup was working fine, but now I when I run a test, I am getting error as follows
Windows 10 PC
Error: ENOENT: no such file or directory, scandir ‘C:\Users\Hp-pc\AppData\Local\Android\sdk\platform-tools\build-tools’
Any suggestions…
I have set path variable in advanced system settings