{"record":{"id":"72f16cf8fdb34191","repo":"microg/GmsCore","slug":"missing-package-name-72f16c","errorCode":null,"errorMessage":"Missing package name","messagePattern":"Missing package name","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"play-services-tapandpay/core/src/main/kotlin/org/microg/gms/tapandpay/TapAndPayService.kt","lineNumber":56,"sourceCode":"import com.google.android.gms.tapandpay.internal.firstparty.RefreshSeCardsRequest\nimport com.google.android.gms.tapandpay.internal.firstparty.SetActiveAccountRequest\nimport com.google.android.gms.tapandpay.internal.firstparty.SetSelectedTokenRequest\nimport com.google.android.gms.tapandpay.issuer.ListTokensRequest\nimport com.google.android.gms.tapandpay.issuer.PushTokenizeRequest\nimport org.microg.gms.BaseService\nimport org.microg.gms.common.GmsService\nimport org.microg.gms.common.GooglePackagePermission\nimport org.microg.gms.common.PackageUtils\nimport org.microg.gms.utils.ExtendedPackageInfo\nimport org.microg.gms.utils.toBase64\nimport org.microg.gms.utils.warnOnTransactionIssues\n\nprivate const val TAG = \"GmsTapAndPay\"\n\nclass TapAndPayService : BaseService(TAG, GmsService.WALLET_TAP_AND_PAY) {\n    override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) {\n        val packageName = PackageUtils.getAndCheckCallingPackage(this, request.packageName)\n            ?: throw IllegalArgumentException(\"Missing package name\")\n        callback.onPostInitCompleteWithConnectionInfo(CommonStatusCodes.SUCCESS, TapAndPayImpl(this, packageName), ConnectionInfo().apply {\n            features = arrayOf(\n                Feature(\"tapandpay\", 1),\n                Feature(\"tapandpay_account_linking\", 1),\n                Feature(\"tapandpay_add_service_listener\", 1),\n                Feature(\"tapandpay_backup_and_restore_tokenize\", 1),\n                Feature(\"tapandpay_block_payment_cards\", 1),\n                Feature(\"tapandpay_check_contactless_eligibility\", 1),\n                Feature(\"tapandpay_check_notification_governance\", 1),\n                Feature(\"tapandpay_dismiss_quick_access_wallet\", 1),\n                Feature(\"tapandpay_enable_secure_keyguard\", 1),\n                Feature(\"tapandpay_felica_tos\", 1),\n                Feature(\"tapandpay_get_active_wallet_infos\", 1L),\n                Feature(\"tapandpay_get_all_cards_for_account\", 1),\n                Feature(\"tapandpay_get_contactless_setup_configuration\", 1),\n                Feature(\"tapandpay_get_data_for_backup\", 1),\n                Feature(\"tapandpay_get_environment\", 1L),\n                Feature(\"tapandpay_get_last_attestation_result\", 1),","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-tapandpay/core/src/main/kotlin/org/microg/gms/tapandpay/TapAndPayService.kt#L38-L74","documentation":"TapAndPayService.handleServiceRequest() resolves the calling package with PackageUtils.getAndCheckCallingPackage(this, request.packageName); if it returns null (caller unknown, uid/package mismatch, or request.packageName absent), it throws IllegalArgumentException(\"Missing package name\") and the service request is rejected before TapAndPayImpl is created.","triggerScenarios":"A client binds and issues a GetServiceRequest whose packageName is null/empty, or whose claimed package does not match the actual calling UID so getAndCheckCallingPackage returns null.","commonSituations":"Client SDK passing no package name in the service request, side-loaded/modified clients spoofing a wrong package, or uid mismatch after app reinstallation while an old binding persists.","solutions":["Ensure the client's GetServiceRequest.packageName is set to the caller's own package name","Reinstall/update the client so its UID matches the declared package signature","Check that the calling app is properly signed and visible to the service (package visibility rules)","On the service side, return a proper error Status instead of throwing if you control the fork"],"exampleFix":"// before\n// client: GetServiceRequest() with packageName unset\n// after\nval request = GetServiceRequest().apply {\n    packageName = context.packageName\n    callingPackage = context.packageName\n}","handlingStrategy":"validation","validationCode":"val request = GetServiceRequest().apply { packageName = context.packageName }","typeGuard":"fun GetServiceRequest.hasValidPackage() = !packageName.isNullOrBlank()","tryCatchPattern":"try { bindAndRequest() } catch (e: IllegalArgumentException) { if (e.message == \"Missing package name\") fixRequestPackageNameAndRetry() }","preventionTips":["Always set packageName on GetServiceRequest to your own package","Keep app signature/UID consistent (avoid reinstall races)","Account for Android package-visibility filtering"],"tags":["kotlin","tapandpay","android","argument-validation"],"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-14T00:17:10.932Z"}