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

2024-04-12

我需要降级我的 minsdk 以保持与某些设备的兼容性,因此我需要将我的版本从 minsdk16 -> 15 降级。 但我有这个错误:

清单合并失败:uses-sdk:minSdkVersion 15 不能更小 比库中声明的版本 16 [com.github.flipagram:android-assetcopier:0.1.1] C:\Users\beto_.gradle\caches\transforms-1\files-1.1\android-assetcopier-0.1.1.aar\7ee049aa00fd85016b1a1ae60ce050df\AndroidManifest.xml 因为该库可能使用 15 建议中不可用的 API: 使用 minSdk 至多 15 的兼容库,或增加 该项目的minSdk版本至少为16,或者使用 tools:overrideLibrary="flipagram.assetcopylib" 强制使用(可能 导致运行时失败)

这是我当前的build.gradle,但是当我将min sdk更改为16时,出现之前显示的错误。

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'

    defaultConfig {
        applicationId "my.package.id"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 510
        versionName "5.1.0"
        manifestPlaceholders = [manifestApplicationId          : "${applicationId}",
                                onesignal_app_id               : "myonesingeid",
                                onesignal_google_project_number: "myprojectnumber"]
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    testImplementation 'junit:junit:4.12'
    implementation 'go.swlib.gojni:swlib:1.0@aar'

    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.onesignal:OneSignal:3.+@aar'
    implementation 'com.google.android.gms:play-services-gcm:16.0.0'
    implementation "com.google.android.gms:play-services-location:16.0.0"
    implementation 'com.google.android.gms:play-services-ads:17.1.2'
    implementation 'com.github.quentin7b:android-location-tracker:3.2'
    implementation 'com.google.firebase:firebase-core:16.0.6'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
//    implementation 'com.google.firebase:firebase-ads:17.1.2'
    implementation 'com.google.firebase:firebase-crash:16.2.1'
    implementation 'org.jetbrains:annotations-java5:15.0'
    implementation 'com.github.hotchemi:android-rate:1.0.1'
    implementation 'com.github.flipagram:android-assetcopier:0.1.1'


}

apply plugin: 'com.google.gms.google-services'

如果我理解得很好,我的错误就在于这种依赖性:

implementation 'com.github.flipagram:android-assetcopier:0.1.1'

希望您能帮忙! 谢谢!


使用最新版本的 Firebase 库所需的最低 SDK 级别为 16。除了备份到这些库的更旧版本之外,没有其他解决方法。

In the 文档 https://firebase.google.com/docs/android/setup它指出:

先决条件

设备运行:

  • Android 4.1(API 级别 16、Jelly Bean)或更高版本
  • Google Play 服务 15.0.0 或更高版本
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Android、Firebase:minSdkVersion 15 不能小于版本 16 的相关文章

随机推荐