【发布时间】:2015-06-27 12:47:43
【问题描述】:
我正在尝试做一个应用程序,但现在 gradle 文件似乎有一些错误。在我升级支持库之前它工作正常。 我正在使用运行良好的 api 21,但后来我升级到 api22 并相应地更改了 gradle 文件。现在出现了这个错误。
Error:Failed to find: com.android.support:support-v4:22.2.0
这是我当前的 gradle 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.sampleapp"
minSdkVersion 12
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.jakewharton:butterknife:6.1.0'
}
任何帮助将不胜感激。
【问题讨论】:
-
如果将
compile 'com.android.support:support-v4:22.2.0'添加到依赖列表会发生什么? -
@Blackbelt:我也得到了同样的错误。
-
你使用的是哪个 gradle 版本?如果过时使用最新版本并编译
-
compile ('com.android.support:design:22.2.0'){ exclude module: 'support-v4' exclude module: 'appcompat-v7' }..尝试添加这个
-
打开您的 SDK 管理器并将构建工具和支持库升级到最新版本。
标签: android android-support-library build.gradle