Could not resolve com.android.tools.build:gradle:1.0.0+.

cordova build android的时候出现

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:1.0.0+.
     Required by:
         :android:unspecified
      > Failed to list versions for com.android.tools.build:gradle.
         > Unable to load Maven meta-data from https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml.
            > Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml'.
               > repo1.maven.org


看到这句话‘   > Could not resolve com.android.tools.build:gradle:1.0.0+.,了解到是gradle出了问题,就更新gradle,并配置到环境变量,就不报错了。下面是操作步骤:

1.打开gradle官网安装自己需要的,https://gradle.org/releases

2.解压后,放到一个目录,在命令行中执行,export PATH=$PATH:/opt/gradle/gradle-3.4/bin

3.gradle -v输出版本号,证明安装成功。

其他:

mac添加环境变量

http://blog.csdn.net/chenguoshuang/article/details/36636339

文章出处:http://www.mengfanyang.com

你可能感兴趣的:(Could not resolve com.android.tools.build:gradle:1.0.0+.)