'Error: the command “android” failed' using cordova

前端 未结 2 522
逝去的感伤
逝去的感伤 2021-01-22 13:32

I\'m trying to get the android platform added on cordova. I\'ve added and downloaded the most recent SDK in Android SDK, my path is :export PATH=${PATH}:/Users/xxx/Develop

2条回答
  •  感情败类
    2021-01-22 13:53

    In case of Apache Cordova with Android Studio 0.8 for Mac OS X 10.9, if you have installed in the default /Applications folder, run this on Terminal

    export ANDROID_HOME="/Applications/Android Studio.app/sdk"
    export ANDROID_TOOLS="/Applications/Android Studio.app/sdk/tools/"
    export ANDROID_PLATFORM_TOOLS="/Applications/Android Studio.app/sdk/platform-tools/"
    PATH=$PATH:$ANDROID_HOME:$ANDROID_TOOLS:$ANDROID_PLATFORM_TOOLS
    

    To confirm, run echo and get

    echo $PATH
    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Applications/Android Studio.app/sdk:/Applications/Android Studio.app/sdk/tools/:/Applications/Android Studio.app/sdk/platform-tools/
    

    For Cordova 3.6, it threw another error on a fresh Android Studio

    Error: Please install Android target "android-19"
    

    To resolve this, open SDK manager in the IDE, and download the mentioned android version (android-19)

提交回复
热议问题