Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unknown calling package name 'com.google.android.gms'

Tags:

android

My android app fails to connect to 'com.google.android.gms'. I checked a lot and implemented all the dependencies I could find to be relevant but it still fails. Actually, the services work fine, both the authentication (with google play and firebase) and the upload/download to the googledrive, so Currently, I'm still releasing the app with this error message, but that can't be too good... Would someone have an idea of what's missing? Here are the key files:

// FILENAME: build.gradle.kts
plugins {
    id("com.android.application") version "8.6.0"
    id("org.jetbrains.kotlin.android") version "1.9.25"
    id("com.google.gms.google-services") version "4.4.2"
}

android {
...
dependencies {
...
    implementation(platform("androidx.compose:compose-bom:2024.09.03"))

    // Firebase dependencies
    implementation(platform("com.google.firebase:firebase-bom:33.4.0"))
    implementation("com.google.firebase:firebase-auth")
    implementation("com.google.firebase:firebase-firestore")
    implementation("io.grpc:grpc-okhttp:1.68.0")
    implementation("io.grpc:grpc-protobuf-lite:1.68.0")
    implementation("io.grpc:grpc-stub:1.68.0")
    implementation("com.google.android.gms:play-services-ads:23.4.0")

    // Google API Client and Drive API
    implementation("com.google.api-client:google-api-client-android:2.7.0")
    implementation("com.google.api-client:google-api-client-gson:2.7.0")
    implementation("com.google.apis:google-api-services-drive:v3-rev20240903-2.0.0")
    implementation("com.google.api-client:google-api-client:2.7.0")
    implementation("com.google.http-client:google-http-client-jackson2:1.45.0")
    implementation("com.google.auth:google-auth-library-oauth2-http:1.28.0")
    implementation("com.google.android.gms:play-services-auth:21.2.0")
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">
...
    <!-- Internet permission -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
...
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

    </application>
</manifest>
## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file should *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=[local sdk path]

The file google-services.json is loaded

Any idea? Many thanks in advance!

I tried implementing all the advice I could find online..

The error message is the following:

Failed to get service from broker.  (Ask Gemini)
                 java.lang.SecurityException: Unknown calling package name 'com.google.android.gms'.
                    at android.os.Parcel.createExceptionOrNull(Parcel.java:3057)
                    at android.os.Parcel.createException(Parcel.java:3041)
                    at android.os.Parcel.readException(Parcel.java:3024)
                    at android.os.Parcel.readException(Parcel.java:2966)
                    at amok.a(:com.google.android.gms@[email protected] (190800-675378931):36)
                    at ammr.z(:com.google.android.gms@[email protected] (190800-675378931):143)
                    at altt.run(:com.google.android.gms@[email protected] (190800-675378931):54)
                    at android.os.Handler.handleCallback(Handler.java:958)
                    at android.os.Handler.dispatchMessage(Handler.java:99)
                    at bqoh.ml(:com.google.android.gms@[email protected] (190800-675378931):1)
                    at bqoh.dispatchMessage(:com.google.android.gms@[email protected] (190800-675378931):5)
                    at android.os.Looper.loopOnce(Looper.java:205)
                    at android.os.Looper.loop(Looper.java:294)
                    at android.os.HandlerThread.run(HandlerThread.java:67)

Note, after that I tried to use the Android Studio Project Structure Dialog to implement all suggestions but it doesn't seem to do any good, the version released for internal testing doesn't connect to any google service anymore...

like image 690
NelDev Studio Avatar asked Aug 14 '26 05:08

NelDev Studio


1 Answers

I also encountered this problem in a similar case.

I saw a reference to a thread on IssueTracker about this problem, it seems to be something that has been flagged for handling by Google, you might want to follow updates there.

like image 197
mmc Avatar answered Aug 15 '26 21:08

mmc