android支持v7 util缺失

时间:2015-06-12 14:44:21

标签: android build android-support-library

我尝试在Android Studio上安装Support7Demos应用程序。 如果我运行项目,我收到以下错误:

Error:(21, 31) error: package android.support.v7.util does not exist

My Gradle文件包含以下库:

dependencies {
    compile "com.android.support:support-v4:22.2.0"
    compile "com.android.support:support-v13:21.0.2"
    compile "com.android.support:cardview-v7:21.0.2"
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.android.support:gridlayout-v7:22.2.0'
    compile 'com.android.support:palette-v7:21.0.0'
    compile 'com.android.support:mediarouter-v7:21.0.0'
}

我使用以下构建工具:

    buildToolsVersion "22.0.1"

有没有人遇到同样的问题?

1 个答案:

答案 0 :(得分:4)

最后,我想出来了:

解决方案是:添加正确的版本:

dependencies {
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.android.support:cardview-v7:22.2.0'
    compile 'com.android.support:gridlayout-v7:22.2.0'
//        compile 'com.android.support:leanback-v17:22.2.0'
    compile 'com.android.support:mediarouter-v7:22.2.0'
    compile 'com.android.support:palette-v7:22.2.0'
    compile 'com.android.support:recyclerview-v7:22.2.0'
    compile 'com.android.support:support-annotations:22.2.0'
    compile 'com.android.support:support-v13:22.2.0'
    compile 'com.android.support:support-v4:22.2.0'
}