1. 程式人生 > >Android Studio如何更新support repository

Android Studio如何更新support repository

分享 host文件 blog mil ria manage mono pop and

剛進新公司,熟悉新業務中。老大叫我看看關於ConstraintLayout的知識,然後果斷看了郭神的博客,講的很好很細,學到不少。剛上道的童鞋可以熟悉一下

http://blog.csdn.net/guolin_blog/article/details/53122387

他的博客中,其中博客中有這麽一句:

compile ‘com.Android.support.constraint:constraint-layout:1.0.0-beta4‘

我的想很多童鞋應該卡在這個地方了,constraint-layout並不能理想的植入到我們的project中,一sycn就報錯!!!ConstraintLayout是Android Studio 2.2中主要的新增功能之一,也是Google在去年的I/O大會上重點宣傳的一個功能,它存在於support repository中,我們知道support repository是Google的支持庫管理工具,可以在項目中添加你想要的功能。

技術分享

如果沒有的話就去SDK Manager中下載:

技術分享

最後就是一個修改host文件的問題了,打開你的host文件。windows在c:\windows\system32\drivers\etc中,Mac在/etc/hosts中,然後插入:

203.208.40.136 dl.google.com 64.233.189.136 dl-ssl.google.com

當然可以用的ip網上很多,你也可以在這裏獲取,作為推介:

http://ping.chinaz.com/

最後從Android Studio中,打開SDK Manager圖標試試,應該可以了。如果還有問題有可能需要換一下你的IP地址,這樣就可以更新support repository中你需要的庫文件了。

Android Studio如何更新support repository