0

I had recently integrated FireStore into my Flutter application and got the following error on launch:

java.lang.SecurityException: Unknown calling package name 'com.google.android.gms'.
    at android.os.Parcel.readException(Parcel.java:2016)
    at android.os.Parcel.readException(Parcel.java:1962)
    at amyk.a(:com.google.android.gms@[email protected]
    at amwr.z(:com.google.android.gms@[email protected]
    at amdz.run(:com.google.android.gms@[email protected]
    at android.os.Handler.handleCallback(Handler.java:809)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at bpbc.ly(:com.google.android.gms@[email protected]
    at bpbc.dispatchMessage(:com.google.android.gms@[email protected]
    at android.os.Looper.loop(Looper.java:166)
    at android.os.HandlerThread.run(HandlerThread.java:65)
2
  • Please provide enough code so others can better understand or reproduce the problem. Commented Jul 14 at 16:38
  • Welcome to StackOverflow. Without details about your flutter application, what libraries did you include, how did you test (emulator, device, OS version) there isn't enough information for anyone to help. Commented Jul 14 at 16:53

1 Answer 1

0
  1. When using Firebase Authentication:

Make sure your Android SDK is up to date. You can do this from Android Studio:

  • Go to Tools > SDK Manager.
  • Check the installed SDK components.
  • If any have updates available, update them.

Updating the SDK resolved the problem for me.

  1. When using Firebase Firestore: I discovered there were conflicting versions of Google Play Services installed. To check this:
  • Use the following ADB command to list the installed versions:
adb shell dumpsys package com.google.android.gms | grep versionName 

  • In my case, I saw two versions:
  • versionName=25.08.32
  • versionName=24.23.35

To fix the conflict:

  • Open your device Settings.
  • Go to Apps > Google Play Services.
  • Reset Google Play Services to the default (base) version.
  • Run the ADB command again to confirm that only one version remains (in my case, versionName=24.23.35).

After this cleanup, the error disappeared.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.