1. 程式人生 > >Android *** android studio Error:Failed to resolve:

Android *** android studio Error:Failed to resolve:

今天,突然之間AS報錯,說’com.android.support:design:23.1.1’找不到了,這怎麼可能,我一直都用著它啊,我一直在app.gradle中新增引用啊

    compile 'com.android.support:design:23.1.1'
  • 1
  • 2

突然就錯了,我就急了,然後經過查詢官網,得知support包位置是

【sdk】\extras\android\m2repository\com\android\support
  • 1

我來到自己電腦的該目錄下,發現果然design找不到了,我覺得這是中邪了,以前都在這個目錄見過他,可是問題最終還是得解決的,我來到了官網,找到了

安裝support教程

根據教程,得出步驟: 
1、點選android綠色小人,就是滑鼠放上去,會提示這是sdk manager的那個圖示 
2、點選launch standalone sdk manager 
3、找到最下面的Extras,再展開找到Android support Repository,勾選它 
4、點選install 1 package(由於我已經安裝過了,但是缺少了design部分,所以先點選delete 1 package 把Android support Repository刪除掉,再重新install一遍)

Android support Library 作用

順便提一下該庫的功能,從官網copy了下來,吃瓜群眾自己翻譯吧,哈哈哈哈!

The Android Support Library offers a number of features      

that are not built into the framework. These libraries     

offer backward-compatible versions of new features, provide   

useful UI elements that are not included in the framework,   

and provide a range of utilities that apps can draw on