之前用Android studio一切正常,不过昨天下午突然报出这样的错误:Could not GET ‘https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.4/gradle-3.1.4.pom’.

试了很多办法,折腾了大半天终于让我给弄好了,具体办法如下:
1.File->Settings->Build,Execution,Deployment->Gradle->Android Studio,把这个对勾打上

现在重新试一下,如果好了就忽略下面的步骤
2.要是还不行那就在build.gradle中添加
maven { url ‘http://maven.aliyun.com/nexus/content/groups/public/’ }
添加之后如下所示:

// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {        repositories {        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }        google()        jcenter()    }    dependencies {        classpath 'com.android.tools.build:gradle:3.1.4'                // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }}allprojects {    repositories {        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }        google()        jcenter()    }}task clean(type: Delete) {    delete rootProject.buildDir}

现在再试一次,反正我是成功了,希望能帮到你。

更多相关文章

  1. 移动端H5的Video标签无法播放在线视频的问题
  2. 上官网学android之二(Building your First APP)
  3. checkbox 与 listview 等混用焦点问题
  4. Android与J2ME区别之我见(1)
  5. 为Android内核添加新驱动,并添加到menuconfig菜单
  6. Android(安卓)UI布局中设置了fill_parenet仍然没有全屏的解决办
  7. UI控件--ImageView和ImageButton
  8. Android(安卓)Activity四种加载方式
  9. 在Windows系统中使用NDK编译Android二进制文件并运行

随机推荐

  1. Android(安卓)自定义日历控件
  2. android监听短信并判断是否未读
  3. Android(安卓)DrawText字符串的绘制
  4. 【Android】Error:(32, 2) error: #error
  5. Android(安卓)代码片段
  6. TextView跑马灯效果
  7. Android(安卓)弹出有确认按键的对话
  8. Android(安卓)8.1 (O)信号强度介绍和定制
  9. Android中的多种文件读写操作方法
  10. 自定义弹窗AlertDialog