cordova Android requirements failed: “Could not find an installed version of Gradle”

前端 未结 17 915
旧时难觅i
旧时难觅i 2020-11-27 03:44

I\'m trying to build a Cordova Android project using the most recent tools. I followed the instructions here:

$ cordova create myApp com.myCompany.myApp myAp         


        
17条回答
  •  难免孤独
    2020-11-27 04:24

    SOLUTION FOR Mac

    Sample problem but I found my solution with brew.
    1. Make sure you have the latest Android Studio installed.
    2. Confirm from SDK manager that you have the required SDKs installed.
    3. (optional)you could have an AVD installed as well.
    4. install Homebrew.

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    

    5. Then run brew update to make sure Homebrew is up to date.

    brew update
    

    6. Run brew doctor to make sure everything is safe

    brew doctor
    

    7. Add Homebrew's location to your $PATH in your .bash_profile or .zshrc file.

    export PATH="/usr/local/bin:$PATH"
    

    8. If you don't have Node already installed, add:

    brew install node
    

    9. (Optional) To test out your Node and npm install, try installing Grunt (you might be asked to run with sudo)

    npm install -g grunt-cli
    

    10. Install Gradle

    brew install gradle
    

    Run: cordova run android --device with you device connected on a Mac and you have gradle working this time.

提交回复
热议问题