1

I am facing this error while running the java mobile automation test case with appium

mvn -Dtest=SavedPhotosTest  test -DFILEPATH="sample.apk"

An unknown server-side error occurred while processing the command. Original error: packageAndLaunchActivityFromManifest failed. Original error: Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path. (WARNING: The server did not provide any stacktrace information)

I've set the ANDROID_HOME in my .bashrc already

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

appium is also running on the another terminal

Configurations:

IntelliJ IDE --> ideaIC-2017.2.4 Android-studio --> android-studio-ide-162.4069837-linux appium --> 1.7.1

I've already tried the following links:

https://discuss.appium.io/t/error-could-not-find-aapt/671/5 Could not find aapt with appium server

https://discuss.appium.io/t/error-could-not-find-aapt/671

How to set IntelliJ IDEA Project SDK

James Z
  • 12,209
  • 10
  • 24
  • 44
ARods
  • 441
  • 2
  • 5
  • 13
  • Try command `find -name aapt` in your `$ANDROID_HOME` and you'll find it's in `build-tools//`. – Lym Zoy Oct 13 '17 at 08:22
  • Hey @LymZoy It's return like this ./build-tools/26.0.2/aapt. What to do with this? – ARods Oct 13 '17 at 08:33
  • Append `/26.0.2` to `$ANDROID_HOME/build-tools` in your `$PATH` variable. – Lym Zoy Oct 13 '17 at 09:00
  • Already tried that. It's not working. appium-settings app opened and closed suddenly. then the ANDROID_HOME error thrown. – ARods Oct 13 '17 at 09:11
  • Sorry, I only know how to solve your `$ANDROID_HOME` problem. I have no experience with appium. – Lym Zoy Oct 13 '17 at 09:15

2 Answers2

0

I was getting same issue. Appium was not able to locate ANDROID_HOME env variable. In my case reason behind this issue was I was running appium with sudo access on my linux machine. If you are running with root privilege, try running without it.

-1

Source it.

source .bashrc

If you did, try reopening every terminal and android studio.

kymbl
  • 11
  • 4