gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 04:10:34 27 4
gpt4 key购买 nike

我开始在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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com