{"record":{"id":"c467c81308cce2de","repo":"microg/GmsCore","slug":"missing-package-name-c467c8","errorCode":null,"errorMessage":"Missing package name","messagePattern":"Missing package name","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"play-services-pay/core/src/main/kotlin/org/microg/gms/pay/PayService.kt","lineNumber":45,"sourceCode":"import com.google.android.gms.pay.GetSortOrderRequest\nimport com.google.android.gms.pay.GetValuablesFromServerRequest\nimport com.google.android.gms.pay.GetValuablesRequest\nimport com.google.android.gms.pay.internal.IPayService\nimport com.google.android.gms.pay.internal.IPayServiceCallbacks\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 = \"PayService\"\n\nclass PayService : BaseService(TAG, GmsService.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, PayServiceImpl(this, packageName), ConnectionInfo().apply {\n            features = arrayOf(\n                Feature(\"pay\", 10),\n                Feature(\"pay_attestation_signal\", 1),\n                Feature(\"pay_pay_capabilities\", 1),\n                Feature(\"pay_feature_check\", 1),\n                Feature(\"pay_get_card_centric_bundle\", 1),\n                Feature(\"pay_get_passes\", 1),\n                Feature(\"pay_get_pay_api_availability_status\", 3),\n                Feature(\"pay_get_se_prepaid_card\", 1),\n                Feature(\"pay_debit_se_prepaid_card\", 1),\n                Feature(\"pay_get_specific_bulletin\", 1),\n                Feature(\"pay_get_transit_cards\", 1),\n                Feature(\"pay_get_wallet_status\", 1),\n                Feature(\"pay_global_actions\", 1),\n                Feature(\"pay_gp3_support\", 1),\n                Feature(\"pay_homescreen_sorting\", 3),\n                Feature(\"pay_homescreen_bulletins\", 2),","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-pay/core/src/main/kotlin/org/microg/gms/pay/PayService.kt#L27-L63","documentation":"PayService.handleServiceRequest handles GMS service connections for the Pay API. It resolves the caller's package with PackageUtils.getAndCheckCallingPackage(this, request.packageName); when the result is null (missing/empty packageName in GetServiceRequest, or the caller does not actually own the claimed package) an IllegalArgumentException 'Missing package name' is thrown.","triggerScenarios":"A client binds to the microG Pay service without setting packageName on GetServiceRequest; the resolved calling package does not match the claimed one; an unverified caller connects directly to the service.","commonSituations":"Outdated or hand-rolled GMS client bindings omitting the package name; package renaming (appId changes) causing caller/claim mismatch; security tooling or tests connecting to the service with minimal requests.","solutions":["Use an up-to-date Google Pay / play-services client library that populates GetServiceRequest.packageName","Ensure the app's manifest package matches the package name passed to Pay APIs","Confirm the calling UID owns the claimed package (signature/UID checks) when connecting directly","Wrap the bind/init call so IllegalArgumentException is surfaced as a configuration error in your app"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"val req = GetServiceRequest().apply {\n    packageName = context.packageName\n    require(!packageName.isNullOrBlank()) { \"packageName required for Pay service\" }\n}","typeGuard":null,"tryCatchPattern":"try {\n    payClient.getAllWallets(...) // or manual bind to PayService\n} catch (e: IllegalArgumentException) {\n    if (e.message == \"Missing package name\") {\n        Log.e(TAG, \"GetServiceRequest.packageName missing; upgrade play-services-wallet client\")\n    } else throw e\n}","preventionTips":["Use current Google Pay / play-services client libraries that populate packageName","Keep the manifest package name consistent with what is passed to Pay APIs","Avoid hand-built GetServiceRequest objects in tests/tools without a valid package name"],"tags":["android","microg","pay","service-binding","package-name"],"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"}