由于下载了最新的SDK并安装了Android Studio,我的项目无法构建。我得到了以下信息:
Error:Gradle: Execution failed for task ':SampleProject:processProdDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version L declared in library com.android.support:support-v4:21.0.0-rc1
我有一些项目,我喜欢针对L.MR1(SDKv22)和一些项目,我喜欢KK(SDKv19)。你的结果可能不同,但这对我很有效。
// Targeting L.MR1 (Android 5.1), SDK 22
android {
compileSdkVersion 22
buildToolsVersion "22"
defaultConfig {
minSdkVersion 9
targetSdkVersion 22
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// google support libraries (22)
compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:cardview-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.3'
}
// Targeting KK (Android 4.4.x), SDK 19
android {
compileSdkVersion 19
buildToolsVersion "19.1"
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// google libraries (19)
compile 'com.android.support:support-v4:19.1+'
compile 'com.android.support:appcompat-v7:19.1+'
compile 'com.android.support:cardview-v7:+'
compile 'com.android.support:recyclerview-v7:+'
}