【发布时间】:2015-05-02 16:07:11
【问题描述】:
构建我的应用时出现以下错误
错误:任务 ':app:processDebugManifest' 执行失败。
清单合并失败:uses-sdk:minSdkVersion 15 不能与库 C:\Users\Sybren-PC\AndroidStudioProjects\Tutorial\app\build\intermediates\exploded-aar\com.android.support 中声明的版本 L 不同\appcompat-v7\21.0.0-rc1\AndroidManifest.xml
我在build.gradle 中尝试了一些东西,但似乎没有任何效果。
错误信息指向这个文件
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2012 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.support.v7.appcompat" >
<uses-sdk
android:minSdkVersion="L"
android:targetSdkVersion="L" />
<application />
</manifest>
AndroidManifest.xml(来自我的项目)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sybren_pc.tutorial" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Build.gradle(模块:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.sybren_pc.tutorial"
minSdkVersion 15
targetSdkVersion 21
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:21.+'
}
谁能帮忙解决这个问题?
编辑
这就是我的 build.gradle 现在的样子。 gradle 构建现在可以了。
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.sybren_pc.tutorial"
minSdkVersion 15
targetSdkVersion 21
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:21.0.0'
我从 SDK 管理器进行的更新:Android SDK 构建工具、Android 支持存储库、Android 支持库
【问题讨论】:
-
没有理由再次使用预览-L,使用api 22
-
你使用的是哪个 gradle 版本?
标签: android android-gradle-plugin