Newly installed Android Studio fails to create a project solution

1. Summary

When I installed Android Studio for the first time, Gradle always misled and couldn't build the project because of the wall and other reasons.

Failed to open zip file.
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)

Two, the solution

The solution is to open the gradle-wrapper.properties file, the content is as follows

#Wed Oct 07 01:37:38 CST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
  • Open the address of the distributionUrl variable: https://services.gradle.org/distributions/, download the corresponding gradle version or the gradle version you want;
  • Unzip the gradle downloaded above to somewhere;
  • Click File—>Settings—>Build, Execution, Deployment—>Gradle
    insert image description here
    After completing the above operations, just click Try.

The above method is also a temporary solution, not a permanent solution. The best way is to successfully create a project, and then download many dependencies to the local, so you don’t need to configure it every time, you can use VPN; or try multiple times, and after each failure, you will go to the following directory, delete the complete gradle in these two directories, and delete the contents of these two folders if you don’t know which folder:

insert image description here

PS: It is best to set the location of the AVD for the first installation, otherwise the virtual machine will be installed to the C drive by default. refer to

Guess you like

Origin blog.csdn.net/qq_36224961/article/details/108946258