我遵循了将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文档和我使用颤振。
app/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'
...
}发布于 2020-10-02 16:36:15
您需要为依赖项指定版本号。您可以在发布说明中找到最新版本。
implementation 'com.google.firebase:firebase-analytics:17.5.0'但是既然你用颤振标记了这个问题,如果你正在构建一个颤振应用程序,你可能应该按照文档中的说明去做。
若要使用此插件,请添加firebase_analytics作为pubspec.yaml中的依赖项文件。您还必须为每个平台项目配置防火墙分析: Android和iOS (一步一步的详细信息,请参阅示例文件夹或https://codelabs.developers.google.com/codelabs/flutter-firebase/#6 )。
您可以在关于颤振的防火文档中进一步阅读
dependencies:
firebase_analytics: ^5.0.2https://stackoverflow.com/questions/64174978
复制相似问题