清单合并失败:uses-sdk:minSdkVersion 1 不能小于版本 7

Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 7(清单合并失败:uses-sdk:minSdkVersion 1 不能小于版本 7)
本文介绍了清单合并失败:uses-sdk:minSdkVersion 1 不能小于版本 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在研究这个 构建简单聊天客户端Parse 我正在使用 gradle 2.4 来构建我的项目.我的 build.gradle 和 AndroidManifest.xml 代码是:

I'm studying this Building Simple Chat Client with Parse and I'm using gradle 2.4 to build my project. My build.gradle and AndroidManifest.xml codes are:

build.gradle

build.gradle

 buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.3'
    }
 }

 apply plugin: 'com.android.application'

 android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"
 }


 repositories {
    jcenter()
 }


 dependencies {
    compile fileTree(dir: 'libs', include: 'Parse-*.jar')
    compile 'com.parse.bolts:bolts-android:1.+'
 }

 dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile 'com.android.support:support-v4:21.0.0'
    compile 'com.android.support:appcompat-v7:21.0.0+'    
    compile 'com.squareup.picasso:picasso:2.5.0'
 }

AndroidManifest.xml

AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application android:label="@string/app_name" 
android:name="main.java.org.hello.ChatApplication">
    <activity
        android:name=".ChatActivity"
        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>

我收到下一个错误:

/home/grados-sanchez/workspace/simplechat/src/main/AndroidManifest.xml:0:0   Error:
uses-sdk:minSdkVersion 1 cannot be smaller than version 7 declared in    library /home/grados-sanchez/workspace/simplechat/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/AndroidManifest.xml
Suggestion: use tools:overrideLibrary="android.support.v7.appcompat" to force usage
:processDebugManifest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller   than version 7 declared in library /home/grados-sanchez/workspace/simplechat/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/AndroidManifest.xml
  Suggestion: use tools:overrideLibrary="android.support.v7.appcompat" to force usage

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --    debug option to get more log output.

BUILD FAILED

你能帮帮我吗

推荐答案

您必须将 minSdkVersion 添加到您的 build.gradle.

You have to add the minSdkVersion to your build.gradle.

否则,gradle 使用 默认值 = 1.
您正在使用带有 minSdk=7 的库,那么您不能使用 minSdk=1.

Otherwise, gradle uses the default value = 1.
You are using a library with minSdk=7, then you can't use minSdk=1.

还要注意 gradle 覆盖 Manifest 中的值.

Also pay attention that gradle overrides the values in the Manifest.

添加如下内容:

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        minSdkVersion 14  
        targetSdkVersion 22
    }
}

注意你的 build.gradle.您有两个依赖项块.你必须合并这些块.

Pay attention to your build.gradle. You have two dependencies blocks. You have to merge these blocks.

这篇关于清单合并失败:uses-sdk:minSdkVersion 1 不能小于版本 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How can I use CClistview in COCOS2d Android?(如何在 COCOS2d Android 中使用 CClistview?)
cocos2d-android: how to display score(cocos2d-android:如何显示分数)
Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)
SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)
Android file copy(安卓文件拷贝)
Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)