我正在尝试做一个应用程序,但现在gradle文件似乎有一些错误。在我升级支持库之前,它一直运行得很好。我正在使用API21,它工作得很好,但后来我升级到了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'
}任何帮助都将不胜感激。
发布于 2015-10-08 18:21:40
如果这可能对某人有帮助,经过多次尝试和错误后,我发现我的目标是与“库”对应的build.gradle文件中错误的SDK版本(一个较旧的版本)。要更改这一点,您可以手动操作或进入模块设置菜单(右键单击您的项目文件夹->打开模块设置。然后在"library“- Properties中,您可以更改编译Sdk和构建工具的版本

发布于 2017-09-09 15:16:37
使用Android SDK管理器。转到Extras,然后转到Android Support Repository,并将其更新为最新版本。
(这基本上是@natario的评论,但它应该是一个答案。)
https://stackoverflow.com/questions/31088937
复制相似问题