刚刚安装好Android studio后,可能会出现gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly,本人也是弄了一天才弄明白,一把辛酸一把泪,下面这些是我整理好的一些大佬的解决方案,这几个方法都可以试试,最中要的就是在gradle系列文件夹下面要拥有gradle-7.0.2-all.zip这个包,如图
然后就是要在wrapper.properties 文件下添加路径,如图(第二行那个)注意一定是-all,有些可能是-bin,我就是将-bin改成-all就行了
最后就是需要在build.gradle配置代码,这是我整个的代码,你们对比着添加
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/