{"record":{"id":"4bd9a40ccee8cc7b","repo":"microg/GmsCore","slug":"missing-package-name-4bd9a4","errorCode":null,"errorMessage":"Missing package name","messagePattern":"Missing package name","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"play-services-core/src/main/kotlin/org/microg/gms/games/GamesService.kt","lineNumber":72,"sourceCode":"import org.microg.gms.auth.signin.checkAccountAuthStatus\nimport org.microg.gms.auth.signin.getServerAuthTokenManager\nimport org.microg.gms.common.Constants\nimport org.microg.gms.common.GmsService\nimport org.microg.gms.common.PackageUtils\nimport org.microg.gms.games.achievements.AchievementsApiClient\nimport org.microg.gms.games.snapshot.SnapshotsDataClient\nimport org.microg.gms.games.utils.AccountPromptManager\nimport org.microg.gms.utils.warnOnTransactionIssues\nimport java.io.File\nimport java.io.FileOutputStream\nimport java.util.regex.Pattern\n\nprivate const val TAG = \"GamesService\"\n\nclass GamesService : BaseService(TAG, GmsService.GAMES) {\n    override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) {\n        val packageName = PackageUtils.getAndCheckCallingPackageOrImpersonation(this, request.packageName)\n            ?: throw IllegalArgumentException(\"Missing package name\")\n\n        fun sendSignInRequired(account: Account? = null) {\n            Log.d(TAG, \"Sending SIGN_IN_REQUIRED to $packageName\")\n            callback.onPostInitCompleteWithConnectionInfo(ConnectionResult.SIGN_IN_REQUIRED, null, ConnectionInfo().apply {\n                params = bundleOf(\n                    \"pendingIntent\" to PendingIntentCompat.getActivity(\n                        this@GamesService,\n                        packageName.hashCode(),\n                        Intent(this@GamesService, GamesSignInActivity::class.java).apply {\n                            putExtra(EXTRA_GAME_PACKAGE_NAME, request.packageName)\n                            putExtra(EXTRA_ACCOUNT, account)\n                            putExtra(EXTRA_SCOPES, request.scopes)\n                        },\n                        PendingIntent.FLAG_UPDATE_CURRENT,\n                        false\n                    )\n                )\n            })","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-core/src/main/kotlin/org/microg/gms/games/GamesService.kt#L54-L90","documentation":"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.","triggerScenarios":"Binding to GmsService.GAMES via GamesService with a GetServiceRequest that has a null packageName and no signature-valid impersonation.","commonSituations":"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.","solutions":["Supply the correct packageName in GetServiceRequest","If impersonating the Games package, ensure signatures match so the impersonation check passes","Fall back to GamesConnectService, which does not permit impersonation but serves regular clients","Verify package visibility/installation of the calling app"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"require(request.packageName != null) { \"packageName required for GamesService bind\" }","typeGuard":null,"tryCatchPattern":"try {\n  gamesClient.connect()\n} catch (e: IllegalArgumentException) {\n  if (e.message == \"Missing package name\") {\n    // fall back to connect endpoint or fix request\n    gamesConnectClient.connect()\n  }\n}","preventionTips":["Populate packageName in GetServiceRequest before binding","Verify impersonation signatures if relying on the impersonation path","Check SIGN_IN_REQUIRED handling separately — package errors happen before auth","Use GamesConnectService as a fallback for non-impersonating clients"],"tags":["play-games","package-validation","service-binding","android"],"backgroundTag":"missing-required-argument","analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}