Android Studio配置Gradle各种问题

Sync 出错之类的,我在安装android studio时候遇到的各种问题:

安装的版本是:
android-studio-2021.2.1.14-windows.exe

File-Settings 里面的配置如下:
在这里插入图片描述
在这里下载对应的gradle包,不用下载-all包,下载-bin包就可以了

https://services.gradle.org/distributions/

然后放到这里:
在这里插入图片描述
gradle-wrapper.properties文件配置:
distributionUrl这一行是什么gradle包,上面就下载什么,下载后关闭android studio再打开就可以了

distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

settings.gradle文件配置:
设置国内镜像源

pluginManagement {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/jcenter'}
        maven { url 'https://maven.aliyun.com/repository/google'}
        maven { url 'https://maven.aliyun.com/repository/central'}
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin'}
        google()
        jcenter()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        maven { url 'https://maven.aliyun.com/repository/jcenter'}
        maven { url 'https://maven.aliyun.com/repository/google'}
        maven { url 'https://maven.aliyun.com/repository/central'}
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin'}
        google()
        jcenter()
    }
}
rootProject.name = "My Application"
include ':app'
  • 0
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值