我正在尝试做一个应用程序,但现在 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'
}
如有任何帮助,我们将不胜感激。
最佳答案
如果这可能对某人有所帮助,经过多次试验和错误后,我发现我在与“库”对应的 build.gradle 文件中定位了错误的 SDK 版本(较旧的版本)。要更改它,您可以手动执行或转到模块设置菜单(右键单击您的项目文件夹 ->打开模块设置。然后在“库” - 属性中,您可以更改编译 Sdk 和构建工具版本
关于android - 未能找到 : com. android.support :support-v4:22. 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31088937/