1. Environment
mac environment, Android Studio 4.0.1
2. Operation steps
The point is to change the distributionUrl in gradle-wrapper.properties to the address of the local offline package
Download the gradle compressed package, address: https://services.gradle.org/distributions/, for the specific version, you can check the version information in distributionUrl in gradle-wrapper.properties in the current local file, for example, mine is like this
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Just download the compressed package of -all
3. Put the zip compressed package of gradle in a local custom path, such as: /Users/hao/program/android_studio_sdk/gradle_local, be careful not to decompress it
4. Find the gradle-wrapper.properties distributionUrl, modify the configuration:
distributionUrl= file:/Users/hao/program/android_studio_sdk/gradle_local/gradle-4.4-all.zip
5. Just sync