gpt4 book ai didi

android - 由于Firebase分析导致Gradle失败

转载 作者:行者123 更新时间:2023-12-03 04:35:42 25 4
gpt4 key购买 nike

我按照说明将Android应用添加到Firebase项目中,但运行代码时出现以下错误:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not find com.google.firebase:firebase-analytics:.
Required by:
project :app

我该如何解决?我只是从官方的Firebase文档中复制并粘贴,而我正在使用Flutter。
应用程序/build.gradle
apply plugin: 'com.google.gms.google-services'
dependencies {
implementation 'com.google.firebase:firebase-analytics'
...
}
android / build.gradle
dependencies{
classpath 'com.google.gms:google-services:4.3.4'
...
}

最佳答案

您需要为依赖项指定一个版本号。您可以在release notes中找到最新版本。

implementation 'com.google.firebase:firebase-analytics:17.5.0'
但是,由于您使用Flutter标记了此问题,因此,如果要构建Flutter应用程序,则可能应遵循 documentation中的说明。

To use this plugin, add firebase_analytics as a dependency in your pubspec.yaml file. You must also configure firebase analytics for each platform project: Android and iOS (see the example folder or https://codelabs.developers.google.com/codelabs/flutter-firebase/#6 for step by step details).


您可以在 Firebase documentation for Flutter中进一步阅读:
dependencies:
firebase_analytics: ^5.0.2

关于android - 由于Firebase分析导致Gradle失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64174978/

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