清单合并失败:uses-sdk:minSdkVersion 1不能小于库中声明的版本14

蓝海豹

我从过去5到7个小时一直在搜索SO和其他android博客,以摆脱一个错误,但没有。在Android Studio中,我导入了一个旧的eclipse项目,但错误“清单合并失败”仍然存在

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 14 declared in library [com.google.android.gms:play-services:11.0.4] C:\Users\.android\build-cache\857c11d37cd8661c3d52cb060657f8bf3635bb7a\output\AndroidManifest.xml
    Suggestion: use tools:overrideLibrary="com.google.android.gms.play_services" to force usage

当我检查在build.gradle中提到minSdkVersion时,我在1m 30s 253ms中以227错误完成Gradle构建,其中一些错误是:

    Z:\#1 ready\others\UVPlayermasterpart1\HoppingBird\app\build\intermediates\res\merged\debug\values-ldltr-v21\values-ldltr-v21.xml
    Z:\#1 ready\others\UVPlayermasterpart1\HoppingBird\app\build\intermediates\res\merged\debug\values-v21\values-v21.xml
Error:(17) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Inverse'.
Error:(19) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large.Inverse'.
Error:(280) Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Material.Light.DialogWhenLarge.NoActionBar'.
Error:(27) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.SearchResult.Subtitle'.
Error:(106, 21) No resource found that matches the given name: attr 'android:colorAccent'.
.
.
.
.Error:(203, 21) No resource found that matches the given name: attr 'android:overlapAnchor'.
.
.

并且在清单文件中使用overrideLibrary无法正常工作。

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "26.0.2"

    defaultConfig {
        applicationId "bb.hoppingbird"
        //minSdkVersion 14
        //targetSdkVersion 19
    }

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

dependencies {
    compile 'com.android.support:support-v4:19.1.0'
    compile 'com.google.android.gms:play-services:+'
}

AndroidManifest.xml

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

    <supports-screens
        android:xlargeScreens="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:anyDensity="false" />

    <application
        android:icon="@drawable/icon"
        android:label="@string/app_name">

        <activity
            android:name="bb.hoppingbird.MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="landscape"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
            android:configChanges="orientation">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <!-- Ads Using Google Play Services SDK -->
        <meta-data android:name="com.google.android.gms.version"
               android:value="@integer/google_play_services_version"/>

        <activity android:name="com.google.android.gms.ads.AdActivity"
             android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
    </application>

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.RESTART_PACKAGES"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />

</manifest>

感谢您的回答。谢谢

迪玛·科热文(Dima Kozhevin)

您应该从以下位置更改:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "26.0.2"

    defaultConfig {
        applicationId "bb.hoppingbird"
        //minSdkVersion 14
        //targetSdkVersion 19
    }

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

dependencies {
    compile 'com.android.support:support-v4:19.1.0'
    compile 'com.google.android.gms:play-services:+'
}

至:

apply plugin: 'com.android.application'
repositories {
    maven { url 'https://maven.google.com' }
}
android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"

    defaultConfig {
        applicationId "bb.hoppingbird"
        minSdkVersion 14
        targetSdkVersion 26
    }

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

dependencies {
    compile 'com.android.support:support-v4:26.1.0'
    compile 'com.google.android.gms:play-services:11.4.2'
}

更新:请按照以下说明进行操作:

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

清单合并失败:uses-sdk:minSdkVersion 19不能小于库中声明的版本21

清单合并失败:uses-sdk:minSdkVersion 15 不能小于库中声明的版本 16

Android Studio 3.4清单合并失败:uses-sdk:minSdkVersion 1不能小于版本14

CordovaJS-错误:清单合并失败:uses-sdk:minSdkVersion 1不能小于版本19中声明的版本

AndroidManifest合并错误:错误:uses-sdk:minSdkVersion 11不能小于库中声明的版本14

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

“清单合并失败:uses-sdk:minSdkVersion 9不能小于版本14”是什么意思?

清单合并失败:uses-sdk:minSdkVersion 14

清单合并失败:uses-sdk:minSdkVersion 8不能更小

Androidx Camera:清单合并失败:uses-sdk:minSdkVersion 16不能小于版本21

Android,Firebase:清单合并失败:uses-sdk:minSdkVersion 15不能小于版本16

清单合并失败:uses-sdk:minSDKVersion1不能小于7

清单合并失败:使用-sdk:minSdkVersion 11

use-sdk:minSdkVersion 7不能小于库中声明的版本9

use-sdk:minSdkVersion 16不能小于库中声明的版本23

错误:(8,5)使用-sdk:minSdkVersion 8不能小于库中声明的版本9

清单合并失败:minSdkVersion与版本L没有区别

use-sdk:minSdkVersion 16不能小于在库[:audioplayers]中声明的版本23

将Recyclerview用于较低的SDK版本时,清单合并失败

清单合并失败1

清单合并失败错误:Gradle 版本问题

Android Gradle中的清单合并失败错误

清单合并失败:属性应用@ appComponentFactory更新火力地堡库

android在本机脚本中获取清单合并失败错误

如何修复React-Native Android中的“清单合并失败”?

Uses-sdk标签未显示在android清单文件中

如何构建应用程序以支持Android中的旧SDK版本(minSdkVersion)

Android,Firebase:minSdkVersion 15不能小于版本16

如何在phonegap中指定最低SDK?它忽略了config.xml中的android-minsdkversion