[Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually

前端 未结 2 677
栀梦
栀梦 2021-02-19 18:46

Im using Cordova in Linux mint 17

I installed android sdk , cordova , android studio , nodejs 4

problem is here when i wanna build app in codova and run this o

相关标签:
2条回答
  • 2021-02-19 19:14

    You should edit /etc/sudoers with

    sudo visudo
    

    At the end of the file enter:

    Defaults    env_keep +="ANDROID_HOME"
    
    0 讨论(0)
  • 2021-02-19 19:23

    I don't think its necessary to add everything into path.Just add the JAVA_HOME , ANDROID_HOME and ANT_HOME to path and point out the corresponding bin directory as:

    For android studio

    add this into your ~/.bashrc file:

    1.export ANDROID_HOME=/path/to/android/studio
    2.export PATH=$PATH:$ANDROID_HOME/bin
    

    you can do the same for Ant.

    For java jdk

    add this into your /etc/profile file:

    1.JAVA_HOME=/path/to/jdk
    2.JRE_HOME=$JAVA_HOME/jre
    3.PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
    4.export JAVA_HOME
    5.export JRE_HOME
    6.export PATH
    

    Now in your terminal, type echo $PATH and make sure all the environment variables are added to the PATH!

    0 讨论(0)
提交回复
热议问题