ARTICLE AD BOX
I am getting a Google Play Services error in my Flutter app after adding Google Sign-In (Firebase Authentication).
The error appears immediately when the app starts, even before triggering the sign-in flow.
Error (shortened logcat)
E/GoogleApiManager: Failed to get service from broker. E/GoogleApiManager: java.lang.SecurityException: Unknown calling package name 'com.google.android.gms' W/GoogleApiManager: ConnectionResult{statusCode=DEVELOPER_ERROR}The stack trace originates from Google Play Services (com.google.android.gms).
Environment
Flutter: 3.x (stable)
Android Studio: latest stable
Device: Android Emulator / Physical device (both tested)
Android version: Android 13–14
firebase_core: latest
firebase_auth: latest
google_sign_in: latest
Configuration
Package name
android/app/build.gradle
android { defaultConfig { applicationId = "com.example.app" } }Package name matches the Firebase Android app configuration.
SHA-1 fingerprint
Debug SHA-1 generated via: ./gradlew signingReport Added in:Firebase Console → Project Settings → Android App → SHA certificate fingerprints
google-services.json
Downloaded again after adding SHA-1
Placed at:
android/app/google-services.json Package name inside JSON matches the app.Gradle plugins
android/app/build.gradle
plugins { id "com.android.application" id "com.google.gms.google-services" id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" }Google Sign-In code
final GoogleSignInAccount? googleUser = await GoogleSignIn().signIn(); final GoogleSignInAuthentication googleAuth = await googleUser!.authentication; final credential = GoogleAuthProvider.credential( accessToken: googleAuth.accessToken, idToken: googleAuth.idToken, ); await FirebaseAuth.instance.signInWithCredential(credential);AndroidManifest (queries section)
<queries> <package android:name="com.google.android.gms" /> <package android:name="com.android.vending" /> </queries>What I already tried
Added SHA-1 fingerprint
Re-downloaded google-services.json
Ran flutter clean
Rebuilt project
Tested on emulator and physical device
Problem
The app runs, but the following error appears on every startup:
ConnectionResult{statusCode=DEVELOPER_ERROR}Sometimes Google Sign-In fails or behaves inconsistently.
Question
What typically causes:
Unknown calling package name 'com.google.android.gms'together with:
ConnectionResult{statusCode=DEVELOPER_ERROR}in a Flutter + Firebase Google Sign-In setup?
Could this be related to:
OAuth client configuration
missing Web client ID
Google Play Services environment issues
or another configuration step I might be missing?
