MAC - 安装Android Studio后出现Cordova错误

时间:2015-11-16 06:31:32

标签: android macos cordova

在Mac OS上 - Cordova在安装Android Studio(4.4.1)后停止工作

注意:它在安装之前工作

出现以下错误:

The command "android" failed. Make sure you have the latest Android SDK installed, and the "android" command (inside the tools/ folder) is added to your path.

并且(在第一个解决之后)

You may not have the required environment or OS to build this project

1 个答案:

答案 0 :(得分:0)

android PATH更改并且没有被cordova更新,我必须这样做:

  1. 更新PATH env var

    touch~ / .bash_profile;打开〜/ .bash_profile

  2. 添加以下行:

    export ANDROID_SDK="/Users/%USR%/Library/Android/sdk"
    export ANDROID_HOME="$ANDROID_SDK"
    export ANDROID_PLATFORM_TOOLS="$ANDROID_SDK/platform-tools"
    export PATH="${PATH}:$ANDROID_HOME/tools:$ANDROID_PLATFORM_TOOLS"
    
    1. platforms/andoridplatforms/android/CordovaLib(第10行)下的local.properties更新为

      sdk.dir = /用户/%USR%/库/的Android / SDK

    2. 其中%USR%是您的用户名