I have tried to connect the Flutter project to the Firebase database many times, but I always get errors. I watched several videos on YouTube, and this is the last one:
The first one
The latest one
And I only have one error left, which is:
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
What should I do?
1
The problem is flutter cannot find the firebase service plugin, so this is how to add the plugin to your project:
- Find
android/settings.gradle
- Add this to your
plugins {}
:
id "com.google.gms.google-services" version "4.4.2" apply false
- Save then try to run.