我多次尝试将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
我该怎么办?
问题是flutter找不到firebase服务插件,所以这是如何将插件添加到您的项目中:
android/settings.gradle
plugins {}
:id "com.google.gms.google-services" version "4.4.2" apply false