2017-03-08 117 views
1

在我的Android工作室,我只能看到支持庫的版本25.0.0,但我的編譯SDK版本是23,當我嘗試添加com.android.support:recyclerview-v7:23.0.4我收到一條錯誤消息,缺少支持庫V7 23

Error:(27, 13) Failed to resolve: com.android.support:recyclerview-v7:23.0.4 

但根據SDK管理器,它顯示我已經安裝了所有的支持庫。

最重要的是,我無法找到菜單

File => Project Structure => Dependencies

這裏v7:23.0.4庫截圖

enter image description here

enter image description here

我的問題

  1. 爲什麼我無法看到的版本V7支持庫:23.0.4?

  2. 如果支持庫沒有安裝怎麼就不能在我的SDK管理器中顯示?

EDIT 1

的build.gradle(Module.app)

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "appnotic.quicknotes" 
     minSdkVersion 18 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:25.0.2' 
} 

編輯2 enter image description here

+0

關於問題2,您看到的「已安裝」是存儲庫,而不是庫 – lelloman

+0

@lelloman然後,我該如何安裝缺失的存儲庫?我還沒有找到它的任何選項 –

+0

我不認爲你錯過了存儲庫,你可以發佈你的模塊build.gradle? – lelloman

回答

1

1)它是不能從爲什麼?我不知道,但它不是最新的版本23,請嘗試com.android.support:recyclerview-v7:23.2.1而不是

2)您不要安裝帶有SDK管理器的庫,只安裝gradle獲取庫的源,庫本身被當你建立

我試着用23.0.4和無法得到它,與23.2.1是下載。如果你可以得到版本25.0.0這意味着存儲庫已安裝,也許gradle項目搞砸了。嘗試刪除項目iml文件和.idea文件夾並重新創建它。

+0

都能跟得上我仍然得到與'com.android.support錯誤:recyclerview-V7:23.2.1' –

+0

好吧,我更新了答案,只是要確定它的工作原理與25.0.0嗎? – lelloman

+0

我只是錯過了appcompat,現在它工作正常 –