android studio提示 Add Google Maven repository and sync project Open File解决安案

1、androidstudio support包报错 add google maven respository and sync project

2、Add Google Maven repository and sync project Open File

在项目下的build.gradle文件下两个地方都加上google()

android studio提示 Add Google Maven repository and sync project Open File解决安案
1、androidstudio support包报错 add google maven respository and sync project

2、Add Google Maven repository and sync project Open File

在项目下的build.gradle文件下两个地方都加上google()

 

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()//加上这行
//用这个替换jcenter(),避免长时间下载不成功jcenter()
maven{ url 'https://maven.aliyun.com/nexus/content/groups/public/'}
// jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
}
}

allprojects {
repositories {
google()//加上这行
maven{ url 'https://maven.aliyun.com/nexus/content/groups/public/'}
//jcenter()
}
}


定制讲解加: 2719046892(微信和QQ同号)
微信二维码: