Search code examples
flutterfirebasegoogle-cloud-firestore

there is error show when build the flutter project


here is the error show when try to build the project

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':app:processDebugGoogleServices'.

> No matching client found for package name 'com.example.charity1_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 10s

Error: Gradle task assembleDebug failed with exit code 1

Solution

  • The error occurs because the package name in your google-services.json file does not match the package name in your AndroidManifest.xml. To fix this:

    Open google-services.json and ensure the package_name under client matches your app's package name. Open AndroidManifest.xml and ensure the package attribute at the top matches the package name in google-services.json. If they don't match, update one of them to ensure consistency. Sync your project with Gradle files and rebuild. This should resolve the issue.