Ubuntu下Android Studio Gradle sync failed peer not authenticated
2016-05-28 19:18
579 查看
最近需要用到Ubuntu,不料遇到了一个奇葩问题,尝试了各种方法没有结果,后来在github上找到了解决方法。原因是https导致的,把证书导入进可以了。参考https://github.com/meteor/meteor/issues/6362#issuecomment-189852511
Go to https://repo1.maven.org.
Click on the green padlock at the left of adress bar.
Click on Details.
Click on View certificate.
Click on Details.
Click on Export.
Export file to “X.509 Certificate (PEM) (.crt; .pem)”
Your $JAVA_HOME variable is normally declared in your .bashrc file, so you can use this command just replacing the /PATH/TO/YOUR/EXPORTED/FILE parameter.
Ubuntu下OpenJDK的默认目录在/usr/lib/jvm/
PS : The default password of java keystore is : changeit
默认的秘钥是changeit,提示输入的时候输入即可。
以上操作重复两遍分别应用于https://jcenter.bintray.com/和https://services.gradle.org/上即可完美解决。
Step 1:Download the certificate
Open Mozilla Firefox :Go to https://repo1.maven.org.
Click on the green padlock at the left of adress bar.
Click on Details.
Click on View certificate.
Click on Details.
Click on Export.
Export file to “X.509 Certificate (PEM) (.crt; .pem)”
Step 2 : Add the certificate to default java keystore
sudo keytool -import -alias MavenRepo -keystore $JAVA_HOME/jre/lib/security/cacerts -file /PATH/TO/YOUR/EXPORTED/FILE.crt
Your $JAVA_HOME variable is normally declared in your .bashrc file, so you can use this command just replacing the /PATH/TO/YOUR/EXPORTED/FILE parameter.
Ubuntu下OpenJDK的默认目录在/usr/lib/jvm/
PS : The default password of java keystore is : changeit
默认的秘钥是changeit,提示输入的时候输入即可。
以上操作重复两遍分别应用于https://jcenter.bintray.com/和https://services.gradle.org/上即可完美解决。
相关文章推荐
- Ubuntu 默认壁纸历代记
- Ubuntu Remix Cinnamon 20.04 评测:Ubuntu 与 Cinnamon 的完美融合
- 使用C++实现JNI接口需要注意的事项
- Android IPC进程间通讯机制
- Android Manifest 用法
- [转载]Activity中ConfigChanges属性的用法
- Android之获取手机上的图片和视频缩略图thumbnails
- Android之使用Http协议实现文件上传功能
- Android学习笔记(二九):嵌入浏览器
- android string.xml文件中的整型和string型代替
- i-jetty环境搭配与编译
- android之定时器AlarmManager
- android wifi 无线调试
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- 关于Ubuntu 11.10启动提示waiting for the network configuration的问题
- 在 Ubuntu 桌面中使用文件和文件夹
- android 代码实现控件之间的间距
- android FragmentPagerAdapter的“标准”配置