Hello,
I am working on a simple android application that utilizes Firebase to store data. I am having the same issue as described above:
Failed to get service from broker.
java.lang.SecurityException: Unknown calling package name 'com.google.android.gms'.
at android.os.Parcel.createExceptionOrNull(Parcel.java:3339)
at android.os.Parcel.createException(Parcel.java:3323)
at android.os.Parcel.readException(Parcel.java:3306)
at android.os.Parcel.readException(Parcel.java:3248)
at auub.a(:com.google.android.gms@251532035@25.15.32 (260400-748827973):36)
at ausi.z(:com.google.android.gms@251532035@25.15.32 (260400-748827973):143)
at atzp.run(:com.google.android.gms@251532035@25.15.32 (260400-748827973):42)
at android.os.Handler.handleCallback(Handler.java:995)
at android.os.Handler.dispatchMessage(Handler.java:103)
at ccwr.mi(:com.google.android.gms@251532035@25.15.32 (260400-748827973):1)
at ccwr.dispatchMessage(:com.google.android.gms@251532035@25.15.32 (260400-748827973):5)
at android.os.Looper.loopOnce(Looper.java:248)
at android.os.Looper.loop(Looper.java:338)
at android.os.HandlerThread.run(HandlerThread.java:85)
All I wanted to do at first is to try the connection between my application and Firestore database and add a simple record:
private void addSimpleTestRecord() {
FirebaseFirestore db = FirebaseFirestore.getInstance();
Map<String, Object> testData = new HashMap<>();
testData.put("test_number", 123);
testData.put("description", "This is a connection test");
testData.put("timestamp", System.currentTimeMillis());
db.collection("test")
.add(testData)
.addOnSuccessListener(documentReference -> {
Log.d(TAG, "DocumentSnapshot added with ID: " + documentReference.getId());
if (getContext() != null) {
Toast.makeText(getContext(), "Success! ID: " + documentReference.getId(), Toast.LENGTH_SHORT).show();
}
})
.addOnFailureListener(e -> {
Log.w(TAG, "Error adding document", e);
if (getContext() != null) {
Toast.makeText(getContext(), "Error: " + e.getMessage(), Toast.LENGTH_LONG).show();
}
});
}
"I made sure my Google Play Services is up to date, my JSON matches everything in the FirebaseConsole for my project, I also added an SHA-1 key after doing a bit of research. But no matter what I do the error is still there."
I did the same and also tried to uninstall the Google Play Services update becuase I read online that the issue may be becuase of two versions of the Google Play Services installed on the phone. I am not using emulator but a physical device with Android 16.