清单合并失败:uses-sdk:minSdkVersion 1不能小于版本7 [英] Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 7

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

问题描述

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



build.gradle

  buildscript {
repositories {
jcenter()
}

依赖关系{
classpath'com.android.tools.build:gradle:1.1.3'
}
}

apply plugin:'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion22.0.1
}


存储库{
jcenter()
}


依赖关系{
编译fileTree(dir:'libs',include:'Parse - *。jar')
compile'c​​om.parse.bolts:螺栓安卓:1. +'
}

依赖关系{
编译fileTree(dir:'libs',include:'* .jar')
compile' com.android.support:support-v4:21.0.0'
compile'c​​om.android.support:appcompat-v7:21.0.0+'
compile'c​​om.squareup.picasso:picasso:2.5 .0'
}

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>
< category android:name =android.intent.category.LAUNCHER/>
< / intent-filter>
< / activity>
< / application>



错误:

  /home/grados-sanchez/workspace/simplechat/src/main/AndroidManifest.xml:0:0错误: 
uses-sdk:minSdkVersion 1不能小于library /home/grados-sanchez/workspace/simplechat/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0中声明的版本7。 0 / AndroidManifest.xml
建议:使用工具:overrideLibrary =android.support.v7.appcompat强制使用
:processDebugManifest失败

失败:构建失败,出现异常。

*出错:
任务'processDebugManifest'的执行失败。
>清单合并失败:uses-sdk:minSdkVersion 1不能小于library /home/grados-sanchez/workspace/simplechat/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0中声明的版本7。 0 / AndroidManifest.xml
建议:使用工具:overrideLibrary =android.support.v7.appcompat强制使用

*尝试:
使用--stacktrace选项运行获取堆栈跟踪。使用--info或 - debug选项运行以获取更多日志输出。

建立失败

请帮助我

解决方案

您必须将 minSdkVersion 添加到 build.gradle



否则,gradle会使用默认值= 1

您正在使用库 minSdk = 7 ,那么你不能使用minSdk = 1。



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



添加如下内容:

  android {
compileSdkVersion 22
buildToolsVersion22.0.1

defaultConfig {
minSdkVersion 14
targetSdkVersion 22
}
}

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


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

 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

<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>

I'm getting the next error:

/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

Could you help me please

解决方案

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

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

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

Add something like this:

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        minSdkVersion 14  
        targetSdkVersion 22
    }
}

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

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

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆