How to use gradle zip in local system without downloading when using gradle-wrapper

后端 未结 10 1792
走了就别回头了
走了就别回头了 2020-12-04 06:29

I\'m trying to build a gradle project with gradle-wrapper (gradlew).

When I build with ./gradlew build, it outputs text

10条回答
  •  执念已碎
    2020-12-04 07:06

    This solution didn't work for me but help me to get the right way so if you want install gradle offline follow these steps:

    1- at your project under gradle directory open this file (gradle-wrapper.properties)

    2- at last line you will find the gradle version, download that version or copy the file from another pc

    distributionUrl=http\://services.gradle.org/distributions/gradle-3.3-bin.zip
    

    Download Link will be like this: http://services.gradle.org/distributions/gradle-3.3-bin.zip

    3- open this location C:\Users\userName.gradle\wrapper\dists\gradle-3.3-all and ensure that is only one folder (the name doesn’t matter it different at devices) if there any other folders delete all of them and press gradle sync on android studio which will generate another folder automatic with a random name.

    4- open that folder and ensure that has only the last two files in the screenshot.

    5- move the zip file that you downloaded into that folder

    6- press sync gradle on android studio again suppose that gradle will work fine.

提交回复
热议问题