[英]Failed to resolve com.android.support:support-annotations 26.0.1
[英]Why does gradle say that it cannot resolve "com.android.support:support-annotations:23.1.1"?
我正在構建一個名為 Shaking 的應用程序。 今天我在項目中添加了一些按鈕庫,即:
Bootstrap 按鈕: https : //android-arsenal.com/details/1/65
扁平按鈕: https : //android-arsenal.com/details/1/68
我在build.gradle
文件的dependencies
塊中添加了以下內容:
compile 'com.beardedhen:androidbootstrap:2.0.1' //This is the bootstrap library
compile 'info.hoang8f:fbutton:1.0.5' //This is the flat buttons library
就像上面的網頁所說的那樣。
然后彈出一個錯誤說:
錯誤:無法解決:com.android.support:support-annotations:23.1.1
一段時間后,我發現引導按鈕庫導致了問題,因為如果我注釋掉該行,就沒有錯誤!
我嘗試關閉 Android Studio 並再次打開它並清理項目,重建......這一切都不起作用。
然后我發現了這個問題
我認為我遇到的問題與此非常相似,因此我按照第二個答案建議的步驟進行操作。 這一次,又出現了一個錯誤:
錯誤:找不到目標 android-23 : C:\\Users\\User\\AppData\\Local\\Android\\sdk
我想我沒有安裝 SDK 23。
我真的很想知道為什么會發生這種情況以及我該如何解決!
下面是 com.beardedhen:androidbootstrap:2.0.1 的 build.gradle:
apply plugin: 'com.android.library'
apply from: 'push.gradle'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 11
targetSdkVersion 23
versionCode = Integer.parseInt(VERSION_CODE)
versionName = VERSION_NAME
}
}
dependencies {
compile 'com.android.support:support-annotations:23.1.1'
}
你可以看到編譯'com.android.support:support-annotations:23.1.1'。
確保您已安裝 android 支持庫 23.1.1:
在 build.grade 模塊應用程序中添加:
實現組:'com.beardedhen',名稱:'androidbootstrap',版本:'2.3.2'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.