最近,我将mindSdkVersion更改为17,将targetSdkVersion更改为21,结果出现了许多错误。我解决了其中一些问题,但是这个问题无法解决:
Error:(28, 13) Failed to resolve: com.android.support:appcompat-v7:21.0.1
我是在 Mac 上使用 Android Studio,我的 Android Support repositories 已经安装好了。
下面是我的 build.gradle 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.swit.sedamaker"
minSdkVersion 17
targetSdkVersion 21
versionCode 2
versionName "1.01"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile 'com.android.support:appcompat-v7:21.0.1'
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
}
targetSdkVersion 21
保留在21吗?尝试升级到23。 - W4R10CK