gpt4 book ai didi

android - 找不到 com.google.firebase :firebase-analytics:

转载 作者:行者123 更新时间:2023-12-05 00:19:02 25 4
gpt4 key购买 nike

我是 firebase 的新手,并尝试在下一个项目中实现 firebase。我包含了如下依赖项,但它显示了上述错误。如果有人能提供信息,我将不胜感激。

我的builder.gradle(app)文件如下:

dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.2.2'

implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-firestore'

testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
apply plugin: 'com.google.gms.google-services'

最佳答案

当您将 Firebase 集成到您的应用程序时,您必须选择 adding dependencies, according to the documentation 两种方式之一。 .您可以选择使用每个依赖项的特定版本,如下所示:

    implementation 'com.google.firebase:firebase-analytics:18.0.0'
implementation 'com.google.firebase:firebase-firestore:22.0.0'

或者,您可以使用 Firebase BoM 为您选择它们​​,基于为您应用特定兼容版本的单个 BoM 版本:

    // Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:26.1.0')

// versions for Firebase SDKs are chosen automatically by the BoM
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-firestore'

看起来您尝试使用 BoM,但没有添加用于选择平台的行。

关于android - 找不到 com.google.firebase :firebase-analytics:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64893041/

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