代码之家  ›  专栏  ›  技术社区  ›  user8542613

Android、Firebase:清单合并失败:使用sdk:MinSDK版本15不能小于版本16

  •  2
  • user8542613  · 技术社区  · 9 年前

    我的 应用程序/版本。格拉德尔 :

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 26
        buildToolsVersion "26.0.1"
        defaultConfig {
            applicationId "com.example.firebase"
            minSdkVersion 15
            targetSdkVersion 26
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
        compile 'com.android.support:appcompat-v7:26.+'
        compile 'com.android.support.constraint:constraint-layout:1.0.2'
    
        compile 'com.google.firebase:firebase-auth:11.0.4'
        compile 'com.firebaseui:firebase-ui-auth:2.3.0'
        compile "com.android.support:design:26.1.0"
        compile "com.android.support:customtabs:26.1.0"
        compile "com.android.support:cardview-v7:26.1.0"
    
        testCompile 'junit:junit:4.12'
    }
    
    
    apply plugin: 'com.google.gms.google-services'
    

    Error:Execution failed for task ':app:processDebugManifest'.
    > Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.firebaseui:firebase-ui-auth:2.3.0] 
    

    我不能改变 MinSDK版本 因为这是客户的要求-在最小版本15上运行Android应用程序

    2 回复  |  直到 6 年前
        1
  •  3
  •   Gabriele Mariotti    9 年前

    你 做不到 这是因为您使用了一些依赖项 minSdk = 16 (在您的情况下 firebase-ui minSdk=16 ).

    您可以选择旧版本的依赖项,但由于您无法更新它们,因此在将来总是会出现问题。

    official dashboard ,今天 .

    你可以 create multiple APKs for Different API Levels .

    productFlavors {
    
        // priority than the second, and so on.
        minApi15 {
          minSdkVersion '15'
          ...
        }
    
        minApi16 {
          minSdkVersion '16'
       }
    }
    
    dependencies {
      minApi15Compile xxxxx
      minApi16Compile xxxxx
    }
    
        2
  •  2
  •   Alex Mamo    9 年前

    为了解决这个问题,您需要降低 com.firebaseui:firebase-ui-auth:2.3.0

    2.3.0 FirebaseUI-Android 您需要使用早期版本,该版本允许您使用 minSdkVersion 15 .

    推荐文章