gradle编译问题:Cause: peer not authenticated

来源:互联网 发布:淘宝神笔我的模块批量 编辑:程序博客网 时间:2024/04/29 17:36
问题:android studio 2.1.2版本,项目使用gradle 2.10,java使用1.7.0_101,
classpath 'com.android.tools.build:gradle:2.1.0',系统ubuntu14.04
在项目中引用下面的库时候,gradle总是编译不了,提示 Cause: peer not authenticated
maven {
url "https://jitpack.io"
}

网上都虽然有人也遇到相识问题,但遇到这个问题的时候,是gradle很老的版本,解决
方案基本都是升级gradle版本,但我使用的gradle2.10算很高了,而且同事电脑使用我相
同的gradle版本(当时没看他们java版本),同样的项目都没问题。

最后,还是在https://jitpack.io官网找到答案。

How do I solve peer not authenticated error in Gradle?

If you are running Gradle on Linux you might get the peer not authenticated error.
There are at least two ways to solve this: - Upgrade to Gradle 2.11 - Run Gradle
with Java 8. The project itself doesn’t need to use Java 8.

解决方案要升级gradle 2.11以上版本,或者使用java 8。
于是再次查看同事的java版本,发现是1.8(java 8)。

最后我升级gradle 2.12后,确实可以了。但如果不看到这段官方原话,即使解决了这个问题也会
很纠结。
1 0
原创粉丝点击