AndroidStudio新建项目报错build failed

报错信息

org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring root project 'Test1'.

Caused by: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring root project 'Test1'

Caused by: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring root project 'Test1'

解决方法

把项目的build.gradle 里的buildscript 和allprojects 改成下面的配置



这是原来的配置

改为如下代码:

buildscript {

    repositories {
// maven库
def cn = "http://maven.aliyun.com/nexus/content/groups/public/"
def abroad = "http://central.maven.org/maven2/"
// 先从url中下载jar若没有找到,则在artifactUrls中寻找
maven {
url cn
artifactUrls abroad
}
maven { url "http://maven.aliyun.com/nexus/content/repositories/jcenter"}
google()
}
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库
def cn = "http://maven.aliyun.com/nexus/content/groups/public/"
def abroad = "http://central.maven.org/maven2/"
// 先从url中下载jar若没有找到,则在artifactUrls中寻找
maven {
url cn
artifactUrls abroad
}
maven { url "http://maven.aliyun.com/nexus/content/repositories/jcenter"}
google()
}
}

AndroidStudio新建项目报错build failed的更多相关文章

  1. maven新建项目报错

    创建了一个maven项目,报错 Errors occurred during the build. Errors running builder 'Maven Project Builder' on ...

  2. cocos run -p android报错 BUILD FAILED ..\ant\build.xml:892

    使用编译指令生成apk文件时,出现这个错误,是因为重复引用了..\YourGame\cocos2d\cocos\platform\android\java\bin\classes.jar文件. 为什么 ...

  3. debian下ror新建项目报错解决

    一个是缺少mysql的开发包 sudo apt-get install libmysqld-dev 还有一个报错如下 debian ExecJS::RuntimeUnavailable: Could ...

  4. Maven项目报错:Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clea

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) ...

  5. coco2dx新建项目报错,ld: -pie can only be used when targeting iOS 4.2 or later clang: error: linker command

    在新建cocos2d-x以后,执行发现下面错误: ld: -pie can only be used when targeting iOS 4.2 or later clang: error: lin ...

  6. 解决nuxt.js新建项目报错的问题

    查了一下nuxt的github才知道是node.js版本太低造成的,据说升级到8.6以上就可以了(本人直接升了9.9) node_modules\nuxt\lib\core\middleware\nu ...

  7. 新建项目报错'/Users/yanguobin/IdeaProjects/Demo/pom.xml' already exists in VFS

    出现该情况的原因:是删除的时候并没有删除干净,点击如下位置会清除Idea的本地代码历史,然后重新创建项目就可以了

  8. Visual Studio 新建项目报错" this template attempted to load component assembly 'NuGet.VisualStudio.Interop, ….".

    "Error: this template attempted to load component assembly 'NuGet.VisualStudio.Interop, Version ...

  9. STS(eclipse)3.7.3新建项目报错:org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration)

    烦人的版本兼容问题 没有使用sts3.7.3系统内嵌的maven3.3.3,调整为稍高版本的maven3.5.2,懒得修改配置了. 升级eclipse插件吧. Eclipse,Help -> I ...

随机推荐

  1. 小白从零开始阿里云部署react项目+node服务接口(一:阿里云服务器)

    准备阿里云服务器,并安装系统 如果没用自己服务器可以购买一个 https://www.aliyun.com/minisite/goods?userCode=x7i5glgc 初级购买一个1核2G的主机 ...

  2. Arcgis api for js实现服务端地图的增删改查

    < !DOCTYPE html > <html xmlns = "http://www.w3.org/1999/xhtml" > <head > ...

  3. OSCP Learning Notes - Exploit(9)

    Tool: Metasploit 1. Start the msfconsole tool. msfconsole 2.Search ssh related modules. 3.Use the &q ...

  4. try-catch- finally块中, finally块唯一不执行的情况是什么?

    除非在try块或者catch块中调用了退出虚拟机的方法(即System.exit(1);),否则不管在try块.catch块中执行怎样的代码,出现怎样的情况,异常处理的finally块总是会被执行的 ...

  5. [并发编程] -- ThreadPoolExecutor篇

    Executor框架 Executor框架的两级调度模型(基于HotSpot) 在上层,Java多线程程序通常把应用分解为若干个任务,然后使用用户级的调度器(Executor框架)将这些任务映射为固定 ...

  6. Monster Audio 使用教程(三)多音轨录音、播放

    在工作站音轨上,把需要进行录音的音轨的录音按钮点亮,然后点击液晶屏旁边的[录音]按钮,开始录音  导出干声 如果希望录音后,导出干声(干声为录下的原始声音,不受效果器的作用),用其他宿主软件进行处理, ...

  7. React native项目后期调整UI总结

    字体 fontSize: 14, marginLeft: 10, marginTop: 2, fontFamily: 'ABBvoiceCNSG-Regular', 布局 paddingHorizon ...

  8. RecyclerView设置空视图

    RecyclerView貌似不能直接设置空视图,所以可以自定义一个RecyclerView继承自RecyclerView并设置一个数据监听者监视数据状态. MyCyclerView.java pack ...

  9. iOS APP下载安装时,如果出现此时无法下载安装APP的字样时,一些解决思路

    1.在iosAPP下载安装时,如果出现此时无法下载安装APP的字样时,可能是苹果系统进行了支持更新,并需要我们确认条约.至于如何判断是否是苹果系统进行了更改,只需要我们进入开发者账号,进入我的账户(A ...

  10. 手牵手,从零学习Vue源码 系列二(变化侦测篇)

    系列文章: 手牵手,从零学习Vue源码 系列一(前言-目录篇) 手牵手,从零学习Vue源码 系列二(变化侦测篇) 陆续更新中... 预计八月中旬更新完毕. 1 概述 Vue最大的特点之一就是数据驱动视 ...