microg/GmsCore · error · IllegalArgumentException

Missing package name

Error message

Missing package name

What it means

GamesService resolves the caller with getAndCheckCallingPackageOrImpersonation; when neither a verified calling package nor a valid impersonation can be established it throws IllegalArgumentException("Missing package name") instead of binding PlayGamesServiceImpl.

Source

Thrown at play-services-core/src/main/kotlin/org/microg/gms/games/GamesService.kt:72

import org.microg.gms.auth.signin.checkAccountAuthStatus
import org.microg.gms.auth.signin.getServerAuthTokenManager
import org.microg.gms.common.Constants
import org.microg.gms.common.GmsService
import org.microg.gms.common.PackageUtils
import org.microg.gms.games.achievements.AchievementsApiClient
import org.microg.gms.games.snapshot.SnapshotsDataClient
import org.microg.gms.games.utils.AccountPromptManager
import org.microg.gms.utils.warnOnTransactionIssues
import java.io.File
import java.io.FileOutputStream
import java.util.regex.Pattern

private const val TAG = "GamesService"

class GamesService : BaseService(TAG, GmsService.GAMES) {
    override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) {
        val packageName = PackageUtils.getAndCheckCallingPackageOrImpersonation(this, request.packageName)
            ?: throw IllegalArgumentException("Missing package name")

        fun sendSignInRequired(account: Account? = null) {
            Log.d(TAG, "Sending SIGN_IN_REQUIRED to $packageName")
            callback.onPostInitCompleteWithConnectionInfo(ConnectionResult.SIGN_IN_REQUIRED, null, ConnectionInfo().apply {
                params = bundleOf(
                    "pendingIntent" to PendingIntentCompat.getActivity(
                        this@GamesService,
                        packageName.hashCode(),
                        Intent(this@GamesService, GamesSignInActivity::class.java).apply {
                            putExtra(EXTRA_GAME_PACKAGE_NAME, request.packageName)
                            putExtra(EXTRA_ACCOUNT, account)
                            putExtra(EXTRA_SCOPES, request.scopes)
                        },
                        PendingIntent.FLAG_UPDATE_CURRENT,
                        false
                    )
                )
            })

View on GitHub (pinned to 157c9d86ac)

Solutions

  1. Supply the correct packageName in GetServiceRequest
  2. If impersonating the Games package, ensure signatures match so the impersonation check passes
  3. Fall back to GamesConnectService, which does not permit impersonation but serves regular clients
  4. Verify package visibility/installation of the calling app
Defensive patterns

Strategy: validation

Validate before calling

require(request.packageName != null) { "packageName required for GamesService bind" }

Try / catch

try {
  gamesClient.connect()
} catch (e: IllegalArgumentException) {
  if (e.message == "Missing package name") {
    // fall back to connect endpoint or fix request
    gamesConnectClient.connect()
  }
}

Prevention

When it happens

Trigger: Binding to GmsService.GAMES via GamesService with a GetServiceRequest that has a null packageName and no signature-valid impersonation.

Common situations: Third-party Play Games clients impersonating com.google.android.play.games without matching signature; client SDKs not filling request.packageName; test harnesses with no package identity.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of microg/GmsCore@157c9d86ac (2026-09-06). Data as JSON: /api/errors/4bd9a40ccee8cc7b. Report an issue: GitHub.