android studio新建项目发生如下错误,如图所示,如何解决?

a1592187525 2018-04-21 12:15:41
如图是在运行下载gradle-3.1.1.pom这个文件吗?但运行完还是不行。

...全文
1385 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
a1592187525 2018-04-21
  • 打赏
  • 举报
回复
引用 2 楼 z979451341 的回复:
如果你的Android Studio是3.0,在项目的build.gradle这样配置,如果不是就升级android Studio

buildscript {
    
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我的是android studio 3.0.1版本build gradle是这样配置的: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } 这应该不用修改了吧,它显示在下载gradle.3.0.1.pom文件,这个文件我已经手动下载下来了,但不知该放到哪个目录下?
键盘舞者113 2018-04-21
  • 打赏
  • 举报
回复
如果你的Android Studio是3.0,在项目的build.gradle这样配置,如果不是就升级android Studio

buildscript {
    
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

r00_a2lBUR 2018-04-21
  • 打赏
  • 举报
回复
重装AS吧~~~~~~~~
键盘舞者113 2018-04-21
  • 打赏
  • 举报
回复
这个配置是自动,只要配置了代码,运行就好了

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧