How to set gradle home while importing existing project in Android studio

后端 未结 29 1228
借酒劲吻你
借酒劲吻你 2020-12-02 04:49

How to set gradle home while importing existing project in Android studio. While trying to import I need to set up this path.

相关标签:
29条回答
  • 2020-12-02 04:57

    If you are on a Windows machine, go to the directory:

    C:\Program Files\Android\Android Studio\gradle\
    

    Click the gradle-4.4 folder from Android Studio\File\Settings, and then click the Apply button.

    0 讨论(0)
  • 2020-12-02 04:58

    OSX (Less han two minutes)

    1. Open terminal
    2. Check if Gradle installed gradle --version, if so, goto step 4
    3. If not brew install gradle and Goto step 2
    4. Copy /usr/local/opt/gradle/libexec/
    5. Paste it in Import Project Window in Android Studio > Gradle Home
    6. Important, Celebrate!
    0 讨论(0)
  • 2020-12-02 04:58

    For migrating from eclipse to android studio

    (Do not need to specify the Gradle home.)

    1. Locate the project you exported from Eclipse, expand it, select the build.gradle file and click OK.
    2. In the following dialog, leave Use gradle wrapper selected and click OK.

    Try this for windows users

    http://blog.blundell-apps.com/setting-up-android-studio-gradle-windows-7/

    0 讨论(0)
  • 2020-12-02 04:58

    For OSX, if going to Finder, navigate to this category: /usr/local/opt/ if you do not see gradle folder, install your grandle version manually:

    https://services.gradle.org/distributions/gradle-5.4.1-all.zip

    https://services.gradle.org/distributions/gradle-4.4.1-all.zip

    If you are looking for specific Gradle version, simply change the version number from the zip links above, unzip and add that in the Gradle folder /usr/local/opt/gradle

    0 讨论(0)
  • 2020-12-02 04:59

    This is my solution on AndroidStudio/Idea for Mac

    $ env | grep GRADLE
    GRADLE_HOME=/usr/local/Cellar/gradle/2.6
    GRADLE_USER_HOME=/Users/leon/.gradle
    
    0 讨论(0)
  • 2020-12-02 04:59

    If you are on a Windows machine, gradle home is located inside the installation folder of your Android Studio, usually at:

    C:\Program Files\Android\Android Studio\gradle\gradle-5.1.1
    

    Change the version if you have a different one.

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