简体   繁体   English

Android Studio Gradle无法找到'com.android.support:design:22.2.0'(Android设计支持库)

[英]Android Studio Gradle cannot find 'com.android.support:design:22.2.0' (the Android Design Support Library)

This issue has been incredibly frustrating for me for the past two weeks. 在过去的两周里,这个问题令我非常沮丧。

Using the Android SDK Manager, I updated the following: 使用Android SDK Manager,我更新了以下内容:

Tools:

Android SDK Tools rev. 24.3.3
Android SDK Platform-tools rev. 22
Android SDK Build-tools rev. 22.0.1

Android 5.1.1 (API 22):

SDK Platform rev. 2
Google APIs rev. 1
Sources for Android SDK rev. 1

Extras:

Android Support Repository rev. 16
Android Support Library rev. 22.2.1
Google Repository rev.22

This is the exact list of all the repositories that I've installed and updated to with the Android SDK Manager. 这是我使用Android SDK Manager安装和更新的所有存储库的完整列表。

However, when I attempt to add the line: 但是,当我尝试添加该行时:

compile 'com.android.support:design:22.2.0'

Gradle becomes stuck on addDependecies. Gradle卡在addDependecies上。 Furthermore, when I go to Module Settings, and then to Dependencies, when I try to add a new library, the 'com.android.support:design:22.2.0' does not appear within the list! 此外,当我转到模块设置,然后转到依赖关系时,当我尝试添加新库时,'com.android.support:design:22.2.0'不会出现在列表中!

Here's additional information about my target, compile, and minimum SDK version: 以下是有关我的目标,编译和最低SDK版本的其他信息:

android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
    applicationId "com.myandroidapplication.newtestapp"
    minSdkVersion 14
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
productFlavors {
}
}

What could I possibly be missing at this point? 那时我可能会错过什么? Thank you! 谢谢!

您必须使用计算机上安装的22.2.1版。

compile 'com.android.support:design:22.2.1'

For me, I was initially adding the support library dependency by typing it out in the build.gradle of my app directly. 对我来说,我最初是通过直接在我的应用程序的build.gradle中输入来添加支持库依赖项。 I cleaned the line that I had typed and added the dependency through the android studio GUI, 我清理了我输入的行,并通过android studio GUI添加了依赖项,

  1. Go to File 转到文件
  2. Choose Project Structure 选择项目结构
  3. Click on the Dependencies tab 单击“依赖关系”选项卡
  4. Click on the + symbol in the upper right conner and choose Library Dependency. 单击右上角的+符号,然后选择Library Dependency。
  5. Search for and add the support library in the dialog that appears 在显示的对话框中搜索并添加支持库
  6. Gradle build/sync should start automatically. Gradle构建/同步应自动启动。

Don't know why, but it works for me at least. 不知道为什么,但它至少对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法解决:Android Studio中的com.android.support:design:27 - Failed to resolve: com.android.support:design:27 in android studio 错误“找不到com.android.support:appcompat-v7:22.2.0” - Error “Could not find com.android.support:appcompat-v7:22.2.0” 无法解决:com.android.support:design-v7:25.3.1 - Failed to resolve: com.android.support: design-v7:25.3.1 在新版本中实现 'com.android.support:design:29.0.3' - Implementation 'com.android.support:design:29.0.3' in new version 无法解决:Android Studio中的com.android.support:design:26.2.0错误 - Failed to resolve: com.android.support:design:26.2.0 error in Android Studio 找不到参数的方法compile()[com.android.support:design:25.1.0] - Could not find method compile() for arguments [com.android.support:design:25.1.0] 我收到错误消息'编译'com.android.support:design:23.0.1'编译'com.android.support:appcompat-v7:23.0.1' - I am getting the error' compile 'com.android.support:design:23.0.1' compile 'com.android.support:appcompat-v7:23.0.1' Android Studio 找不到 com.android.support:support-v4:19.1.0 - Android Studio doesn't find com.android.support:support-v4:19.1.0 Gradle和Android:无法解析依赖项com.android.support - Gradle and Android: Could not resolve dependencies com.android.support 无法为参数找到方法Compile()[com.android.support:support - Could not find method Compile() for arguments [com.android.support:support
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM