错误:(30,13)未能解析:libs/com.android。支持:appcompat-v7:22.2.1

错误:(30,13)未能解析:libs/com.android。支持:appcompat-v7:22.2.1,android,android-gradle-plugin,android-support-library,android-appcompat,Android,Android Gradle Plugin,Android Support Library,Android Appcompat,我有一个错误: Error:(30, 13) Failed to resolve: libs/com.android.support:appcompat-v7:22.2.1 这里是我的build.gradle文件: apply plugin: `com.android.application` android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig

我有一个错误:

Error:(30, 13) Failed to resolve: libs/com.android.support:appcompat-v7:22.2.1
这里是我的
build.gradle
文件:

apply plugin: `com.android.application`

    android {
        compileSdkVersion 25
        buildToolsVersion "25.0.2"
        defaultConfig {
            applicationId "com.example.guestadmin.myapplication"
            minSdkVersion 15
            targetSdkVersion 25
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }

    dependencies {

        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
        compile 'com.android.support:appcompat-v7:25.2.0'
        testCompile 'junit:junit:4.12'

        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'libs/com.android.support:appcompat-v7:22.2.1'

    }
错误在这里:

compile 'libs/com.android.support:appcompat-v7:22.2.1'
您使用了错误的语法-您可能对单个jar或多个jar文件有依赖关系。
使用单个jar文件,您可以添加:

dependencies {
    compile files('libs/local_dependency.jar')
}
可以添加要编译的JAR目录

dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
}
在任何情况下,您仍在导入项目中的所有jar文件,因为您正在使用:

compile fileTree(dir: 'libs', include: ['*.jar'])
但请注意以这种方式导入支持库。
您正在导入该文件,因为您正在使用

compile 'com.android.support:appcompat-v7:25.2.0'

而且此库还有其他依赖项和资源文件,因此它会给您一个错误。

任何人都可以告诉我为什么会出现30-13错误。请检查appcompat.v7:22.2.1库是否正确引用?可能您的版本已更改或找不到?如果您仍然需要,我会再次删除引用并将其添加回。