如何将 flutter 项目与 firebase 连接?

问题描述 投票:0回答:1

我多次尝试将Flutter项目连接到Firebase数据库,但总是出错。我在 YouTube 上看了几个视频,这是最后一个:

第一个

最新的

我只剩下一个错误,那就是:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find com.google.gms.google-services:4.4.2:.
     Required by:
         project :

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 3s

我该怎么办?

database flutter firebase
1个回答
0
投票

问题是flutter找不到firebase服务插件,所以这是如何将插件添加到您的项目中:

  1. 寻找
    android/settings.gradle
  2. 将此添加到您的
    plugins {}

id "com.google.gms.google-services" version "4.4.2" apply false

  1. 保存然后尝试运行。
© www.soinside.com 2019 - 2024. All rights reserved.