【发布时间】:2014-08-18 02:43:27
【问题描述】:
我已经开发这个小项目几天了,但是今天突然,Android Studio 开始给我这个错误
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 14 declared in library com.android.support:support-v4:21.0.0-rc1
我明白这是因为它正在尝试编译Android-L的库。我希望它编译的版本是旧版本,但不会。无论我输入哪个版本,它都会不断给我上述错误。这是依赖项。
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:20.+'
compile 'com.android.support:support-v4:20.+'
}
更新
我刚刚安装了 Android Studio Beta 并将我的依赖项更改为 Eugen 下面建议的那个。但是无论我指定哪个版本的 appcompat 和支持版本,同步项目都会产生相同的错误。每次同步时都会出现此错误
uses-sdk:minSdkVersion 14 cannot be smaller than version L declared in library com.android.support:support-v4:21.0.0-rc1
我更新的依赖项
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
compile 'com.android.support:support-v4:19.+'
}
更新 2
我认为我没有正确理解 Android Studio 的依赖系统。我刚刚从依赖项中删除了 appcompat 和 support,它仍然给我同样的错误。我是否必须从某处删除最初包含的库?
build.gradle
*note - 我再次添加了这两个库并尝试同步,以防万一。但没有 chenges。
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "taz.starz.footynews"
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
compile 'com.android.support:support-v4:19.+'
compile project(':ParallaxScroll')
compile files('src/main/libs/Header2ActionBar-0.2.1.jar')
compile 'com.arasthel:gnavdrawer-library:+'
compile 'com.koushikdutta.ion:ion:1.2.4'
}
顶级 build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
【问题讨论】:
-
看起来您有多模式项目。你的父母 build.gradle 是什么?
-
您的意思是顶级 build.gradle 文件?
-
视差滚动项目的依赖关系是什么?
-
是的,顶级 build.gradle
-
它的 build.gradle 文件不包含任何依赖项,也没有 .jar 文件。所以我假设它没有任何依赖关系?
标签: android android-studio gradle android-gradle-plugin build.gradle