android maven plugin does not get ANDROID_HOME env variable in Eclipse

前端 未结 9 2181
[愿得一人]
[愿得一人] 2021-02-20 11:23

i\'m working on an Android app project and it is a Maven project. when i try to run as \"maven install\" this is what i get:

\"Failed to execute goal com.jayway.maven.pl

9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-20 12:01

    If you are using Linux, exporting the ANDROID_HOME in the .bashrc may not work.

    export ANDROID_HOME=/home/toro/etc/android-sdk-linux
    

    For me it works only when I export ANDROID_HOME in the /etc/environment file like this:

    ANDROID_HOME=/home/toro/etc/android-sdk-linux
    

    You have to restart the computer to get it works.

    You simply have to log out, and log in again for the environment variable to be applied system-wide. Optionally, you could just source it locally to test it out before you do that: $source /etc/environment

提交回复
热议问题