5
Android Studio通过gradle同步工程失败
source link: https://xmanyou.com/android-studio-gradle-sync-fail/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
25 February 2020
/ 开发笔记
Android Studio通过gradle同步工程失败
最近遇到一个奇怪的问题,不确定是怎么出现的,但是记录一下解决的过程。
Android Studio 版本:3.4.1
正常情况下,要想能够使用Android Studio来更新Android的各种插件,我们需要在Android Studio里配置proxy:
这个配置很久以来一直都工作很正常,昨天突然就报错了
奇怪了,明明给gradle配置了proxy,为什么会失败了呢?
- 禁用gradle代理
然后sync时,不要把Android Studio的proxy设置同步到gradle里,弹窗选择Cancel
然后,就sync就成功了……
禁用了代理,反而成功了???
对。
为什么?
我不知道……
- 使用国内镜像
这是一个比较安全的做法。
// google()
// jcenter()
maven{ url 'https://maven.aliyun.com/repository/google'}
maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'}
maven{ url 'https://maven.aliyun.com/repository/public'}
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
我又测试了一下,关闭Androi Studio自己代理,打开Sdk Manager,好像也一切正常……
先记录下来,后边又新发现再更新。
阿斌
Read more posts by this author.
扫一扫关注微信公众号:耿直的IT男阿斌
聊一聊IT男眼中的世界
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK