为什么可以';我在android Studio的Choose Library Dependency中找到com.android.support:design:22.2.0?

为什么可以';我在android Studio的Choose Library Dependency中找到com.android.support:design:22.2.0?,android,android-studio,Android,Android Studio,我希望在Android Studio中使用Snackbar,我已经读过了 所以我在build.gradle中添加了compile'com.android.support:design:22.2.0'。Snackbar.make(…)运行良好 我在Android Studio中打开Projec结构,我想我可以在Choose Library Dependency UI中找到com.Android.support:design:22.2.0项,但事实上该项没有列出,为什么 顺便说一句,我已经更新了我的

我希望在Android Studio中使用Snackbar,我已经读过了

所以我在build.gradle中添加了compile'com.android.support:design:22.2.0'。Snackbar.make(…)运行良好

我在Android Studio中打开Projec结构,我想我可以在Choose Library Dependency UI中找到com.Android.support:design:22.2.0项,但事实上该项没有列出,为什么

顺便说一句,我已经更新了我的安卓系统

选择库依赖项屏幕截图

更新的屏幕截图

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "info.dodata.messagecleanup"
        minSdkVersion 9
        targetSdkVersion 22
        versionCode 9
        versionName "1.09"
        archivesBaseName = "MessageCleanup-V" + versionName
    }


    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'           
        }

        debug {            
        }
    }
}


dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.1.1'
    compile 'com.google.android.gms:play-services:7.3.0'
    compile 'com.android.support:design:22.2.0'
}
Snackbar.make(mView, "Hello SnackBar!", Snackbar.LENGTH_SHORT)
                        .setAction("Undo", new View.OnClickListener() {
                            @Override
                            public void onClick(View v) {
                                // Perform anything for the action selected
                                Toast.makeText(mContext, "I click Undo",Toast.LENGTH_LONG).show();
                            }
                        })
                        .show();
我的代码

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "info.dodata.messagecleanup"
        minSdkVersion 9
        targetSdkVersion 22
        versionCode 9
        versionName "1.09"
        archivesBaseName = "MessageCleanup-V" + versionName
    }


    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'           
        }

        debug {            
        }
    }
}


dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.1.1'
    compile 'com.google.android.gms:play-services:7.3.0'
    compile 'com.android.support:design:22.2.0'
}
Snackbar.make(mView, "Hello SnackBar!", Snackbar.LENGTH_SHORT)
                        .setAction("Undo", new View.OnClickListener() {
                            @Override
                            public void onClick(View v) {
                                // Perform anything for the action selected
                                Toast.makeText(mContext, "I click Undo",Toast.LENGTH_LONG).show();
                            }
                        })
                        .show();
  • 打开SDK管理器,然后将Android支持库、Android支持存储库更新为最新版本
  • 配置
    AndroidManifest.xml
    ,compileSdkVersion>=22,buildToolsVersion>=22(因为设计库只支持API>=22)
  • 打开
    sdk\extras\android\m2repository\com\android\support
    以准确了解我们现在的版本

    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.android.support:design:22.2.0'
    
    请注意,我们需要添加两个版本相同的库(22.2.0或…)

  • 建设成功

  • 最新版本为22.2.1。你确定你已经从sdk管理器中更新了你的存储库吗?google respostiory也更新了。谢谢!但我不明白“谷歌重新发布更新”是什么意思?这是否意味着谷歌忘记列出com.android.support:design:22.2.0在Choose Library Dependency UI22.2.1中是最新的。只需更新google存储库并检查helpsBTW,我的Android Studio的版本号是1.2.2,我是否需要升级Android Studio以显示com.Android。支持:设计:选择库依赖项UI中的22.2.0项