清单合并失败:使用-SDK:8的minSdkVersion不能小清单、SDK、minSdkVersion

2023-09-05 06:21:19 作者:失去多了也就成熟了i

现在的问题是...

 错误:未能执行任务:应用程序:processDebugManifest。
 

  

清单合并失败:使用-SDK:8的minSdkVersion不能比L型小库com.android.support:support-v4:21.0.0-rc1声明

在code在build.gradle

 应用插件:'机器人'

安卓{
    compileSdkVersion 19
    buildToolsVersion20.0.0

    defaultConfig {
        的applicationIDcom.androidexample.gcm
        的minSdkVersion 8
        targetSdkVersion 16
    }

    buildTypes {
        推出 {
            runProguard假
            proguardFiles getDefaultProguardFile('ProGuard的-android.txt'),'ProGuard的-rules.txt
        }
    }
}

依赖{
    编译com.android.support:support-v4:+
    编译com.google.android.gms:播放服务:+
    //编译com.android.support:support-v4:20.0.0
    //编译com.google.android.gms:玩-服务:5.0.77

}
 

code在AndroidManifest是...

 < XML版本=1.0编码=UTF-8&GT?;
<舱单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    包=com.androidexample.gcm
    安卓版code =1
    机器人:VERSIONNAME =1.0>

    <! -  GCM需要的Andr​​oid SDK 2.2版本(API 8级)或以上。 - >
    <用途-SDK
        安卓的minSdkVersion =8
        机器人:targetSdkVersion =16/>

    <! - 主要活动。 - >
    <应用
        机器人:名称=com.androidexample.gcm.Controller
        机器人:图标=@可绘制/ ic_launcher
        机器人:标签=@字符串/ APP_NAME>
        <! - 注册活动 - >
        <活动
            机器人:名称=com.androidexample.gcm.RegisterActivity
            机器人:标签=@字符串/ APP_NAME>
            <意向滤光器>
                <作用机器人:名称=android.intent.action.MAIN/>
                <类机器人:名称=android.intent.category.LAUNCHER/>
            &所述; /意图滤光器>
            <意向滤光器>
                <作用机器人:名称=android.intent.action.VIEW/>
                <作用机器人:名称=android.intent.action.DELETE/>
                <类机器人:名称=android.intent.category.DEFAULT/>
                <数据机器人:计划=com.idrivecare.familypro/>
            &所述; /意图滤光器>
        < /活性GT;


        <! - 主要活动 - >
        <活动
            机器人:名称=com.androidexample.gcm.MainActivity
            机器人:configChanges =方向| keyboardHidden
            机器人:标签=@字符串/ APP_NAME>
        < /活性GT;

        <接收器
            机器人:名称=com.google.android.gcm.GCMBroadcastReceiver
            机器人:权限=com.google.android.c2dm.permission.SEND>
            <意向滤光器>

                <  - !接收的实际消息。 - >
                <作用机器人:名称=com.google.android.c2dm.intent.RECEIVE/>
                &所述;! - 接收的注册ID。 - >
                <作用机器人:名称=com.google.android.c2dm.intent.REGISTRATION/>

                <类机器人:名称=com.androidexample.gcm/>
            &所述; /意图滤光器>
        < /接收器>

        <服务机器人:名称=com.androidexample.gcm.GCMIntentService/>
        <元数据的android:NAME =com.google.android.gms.version机器人:值=@整数/ google_play_services_version/>
    < /用途>

    <! -  GCM连接到互联网服务。 - >
    <使用-权限的Andr​​oid:名称=android.permission.INTERNET对/>

    <! -  GCM需要一个谷歌帐户。 - >
    <使用-权限的Andr​​oid:名称=android.permission.GET_ACCOUNTS/>

    <! - 进入休眠状态保持处理器接收到消息时。 - >
    <使用-权限的Andr​​oid:名称=android.permission.WAKE_LOCK/>

    <! - 创建一个自定义权限所以只有这个程序可以接收它的消息。 - >
    <许可
        机器人:名称=com.androidexample.gcm.permission.C2D_MESSAGE
        安卓的ProtectionLevel =签名/>

    <使用-权限的Andr​​oid:名称=com.androidexample.gcm.permission.C2D_MESSAGE/>

    <  - !此应用程序有权限注册并接收数据信息。 - >
    <使用-权限的Andr​​oid:名称=com.google.android.c2dm.permission.RECEIVE/>

    <! - 网络状态的权限来检测网络状态 - >
    <使用-权限的Andr​​oid:名称=android.permission.ACCESS_NETWORK_STATE/>

    <! - 权限振动 - >
    <使用-权限的Andr​​oid:名称=android.permission.VIBRATE/>

< /舱单>
 
SDK安装失败,请问这种问题应该解决

谢谢主席先生。

解决方案

如果您使用

 com.android.support:support-v4:+
 

这将假设它可以使用21.x,因为是最新的版本(但目标小于L不兼容)

将其更改为

 com.android.support:support-v4:20.+
 

因此​​,它会下载最新的20.x版本

The problem is..

Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller than version L declared in library com.android.support:support-v4:21.0.0-rc1

The code in build.gradle

   apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.androidexample.gcm"
        minSdkVersion 8
        targetSdkVersion 16
    }

    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:support-v4:+'
    compile 'com.google.android.gms:play-services:+'
    //compile 'com.android.support:support-v4:20.0.0'
    //compile 'com.google.android.gms:play-services:5.0.77'

}

Code in the AndroidManifest is ..

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.androidexample.gcm"
    android:versionCode="1"
    android:versionName="1.0" >

    <!-- GCM requires Android SDK version 2.2 (API level 8) or above. -->
    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="16" />

    <!-- Main activity. -->
    <application
        android:name="com.androidexample.gcm.Controller"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <!-- Register Activity -->
        <activity
            android:name="com.androidexample.gcm.RegisterActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <action android:name="android.intent.action.DELETE" />
                <category android:name="android.intent.category.DEFAULT" />  
                <data android:scheme="com.idrivecare.familypro" />
            </intent-filter>
        </activity>


        <!-- Main Activity -->
        <activity
            android:name="com.androidexample.gcm.MainActivity"
            android:configChanges="orientation|keyboardHidden"
            android:label="@string/app_name" >
        </activity>

        <receiver
            android:name="com.google.android.gcm.GCMBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>

                <!-- Receives the actual messages. -->
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <!-- Receives the registration id. -->
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <category android:name="com.androidexample.gcm" />
            </intent-filter>
        </receiver>

        <service android:name="com.androidexample.gcm.GCMIntentService" />
        <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
    </application>

    <!-- GCM connects to Internet Services. -->
    <uses-permission android:name="android.permission.INTERNET" />

    <!-- GCM requires a Google account. -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />

    <!-- Keeps the processor from sleeping when a message is received. -->
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <!-- Creates a custom permission so only this app can receive its messages. -->
    <permission
        android:name="com.androidexample.gcm.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.androidexample.gcm.permission.C2D_MESSAGE" />

    <!-- This app has permission to register and receive data message. -->
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

    <!-- Network State Permissions to detect Internet status -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <!-- Permission to vibrate -->
    <uses-permission android:name="android.permission.VIBRATE" />

</manifest>

Thank you sir..

解决方案

If you use

'com.android.support:support-v4:+'

It will suppose it can use 21.x since is the latest version (but not compatible with target less than L)

Change it to

'com.android.support:support-v4:20.+'

So it will download the latest 20.x version