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

后端 未结 29 1227
借酒劲吻你
借酒劲吻你 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 05:07

    This worked. C:\Program Files\Android\Android Studio\gradle\gradle-3.2

    0 讨论(0)
  • 2020-12-02 05:08
    1. Download Gradle http://www.gradle.org/downloads
    2. Install
    3. Set Gradle home to the install directory
    0 讨论(0)
  • 2020-12-02 05:08

    I tried byteit101's solution but whether I chose android-studio-path/plugins/gradle or android-studio-path/plugins/gradle/lib the IDE said it isn't correct.

    Then I changed the gradle home to android-studio-path/gradle/gradle-x.x.x and it works.

    0 讨论(0)
  • 2020-12-02 05:10

    Mac OSX / Linux

    Step 1: Open terminal :)
    Step 2: Open .bash_profile in vim to edit: 
            > vi ~/.bash_profile 
    Step 3: Add line: 
            > export GRADLE_HOME=/usr/local/opt/gradle 
            (for me it was this location, it can be different for u)
    Step 4: Add line: 
            > export PATH="$PATH:$GRADLE_HOME/bin" 
            (to export bin directory of gradle)
    Step 5: Verify by reopening the terminal or new tab, and check by echoing: 
            > echo $GRADLE_HOME
    
    0 讨论(0)
  • 2020-12-02 05:11

    For Mac OS, you can use the following -

    1. /usr/local/opt/gradle/libexec/ or more generically - path/to/gradle/libexec/ - this is recommended. (the first path is what's achieved after installing gradle via Homebrew)
    2. /path/to/android/studio/plugins/gradle - I don't recommend this because this version of Gradle might be out of date, and Android Studio itself might say it's incompatible.
    0 讨论(0)
  • 2020-12-02 05:11

    If you're using MacPorts gradle's home is:

    /opt/local/share/java/gradle
    
    0 讨论(0)
提交回复
热议问题