java - 如何解决 android studio 中的这个依赖问题?

标签 java android

我开始在android studio中构建一个项目,在添加一些firebase身份验证依赖项后遇到了这个问题..并且'com.android.support:appcompat-v7:28.0.0'下似乎有一条弯曲的红线。

这是 gradle 应用程序代码:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.aden.adenmarket"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.google.firebase:firebase-core:17.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.google.firebase:firebase-auth:18.0.0'
}
apply plugin: 'com.google.gms.google-services'

这是项目 gradle :

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.0'
        classpath 'com.google.gms:google-services:4.2.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

...... 这是输出错误:

ERROR: Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.google.firebase:firebase-auth:18.0.0] C:\Users\PC.gradle\caches\transforms-2\files-2.1\ce1ab53339b3343f02313d46e1b6166b\AndroidManifest.xml as the library might be using APIs not available in 15 Suggestion: use a compatible library with a minSdk of at most 15, or increase this project's minSdk version to at least 16, or use tools:overrideLibrary="com.google.firebase.auth" to force usage (may lead to runtime failures)

最佳答案

尝试将 minSdkVersion 更改为 16。

关于java - 如何解决 android studio 中的这个依赖问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56690886/

相关文章:

java - Prowide-Core Library - 无法在 MT564 swift 消息中获取序列 E 标签

android - 仅当 Activity 暂停时才会收到待处理的 Intent 额外内容

Android,完成所有 Activity

android - 在 android 中创建了新类,但无法弄清楚上下文

java - 使用 proguard 的 Android 混淆应用程序保留 jar 库

java - 如何使用 webdriver、testng 编写测试来检查浏览器向下滚动?

java - 为什么在 PoolingClientConnectionManager 中弃用所有方法?

java - 如何拆分字符串并将其保存到变量(如果有效)?

java - 无法实例化类;没有空构造函数

java - 返回 MembersInjectors.injectMembers 时出错