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

前端 未结 17 965
旧时难觅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:28

    Solution for linux with apt-get (eg.: Ubuntu, Debian)

    I have quite similar problem. I obtained error:

    Error: Could not find an installed version of Gradle either in Android Studio,
    or on your system to install the gradle wrapper. Please include gradle 
    in your path, or install Android Studi
    

    but without Exception. I solved it on Ubuntu by

    sudo apt-get install gradle
    

    I found also commands that allows install newest version of gradle in Ubuntu. It works only when first command is executed before (probably some dependecies are incorrect).

    sudo add-apt-repository ppa:cwchien/gradle
    sudo apt-get update
    sudo apt-get install gradle-ppa
    

    https://wtanaka.com/node/8079

    If it does not work, try:

    export PATH=$PATH:/opt/gradle/gradle-3.5/bin
    

    More info:

    https://askubuntu.com/questions/915980/package-is-installed-and-is-not-detected-gradle/915993#915993

    For CentOS

    Instruction of instalation gradle for CentOS is under this link

    https://gist.github.com/parzonka/9371885

    Update

    Now I installing gradle by sdkman it is something like nvm for node.

    Install sdkman

    curl -s "https://get.sdkman.io" | bash 
    

    Install gradle

    sdk install gradle 4.0.2
    

提交回复
热议问题