{"record":{"id":"366071def3b429eb","repo":"microg/GmsCore","slug":"missing-package-name-366071","errorCode":null,"errorMessage":"Missing package name","messagePattern":"Missing package name","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"play-services-location/core/src/main/kotlin/org/microg/gms/location/reporting/ReportingAndroidService.kt","lineNumber":21,"sourceCode":" * SPDX-License-Identifier: Apache-2.0\n */\npackage org.microg.gms.location.reporting\n\nimport android.os.RemoteException\nimport com.google.android.gms.common.api.CommonStatusCodes\nimport com.google.android.gms.common.internal.ConnectionInfo\nimport com.google.android.gms.common.internal.GetServiceRequest\nimport com.google.android.gms.common.internal.IGmsCallbacks\nimport org.microg.gms.BaseService\nimport org.microg.gms.common.GmsService\nimport org.microg.gms.common.PackageUtils\nimport org.microg.gms.location.manager.FEATURES\n\nclass ReportingAndroidService : BaseService(\"GmsLocReportingSvc\", GmsService.REPORTING) {\n    @Throws(RemoteException::class)\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(\n            CommonStatusCodes.SUCCESS,\n            ReportingServiceInstance(this, packageName),\n            ConnectionInfo().apply { features = FEATURES }\n        )\n    }\n}\n","sourceCodeStart":3,"sourceCodeEnd":29,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-location/core/src/main/kotlin/org/microg/gms/location/reporting/ReportingAndroidService.kt#L3-L29","documentation":"ReportingAndroidService.handleServiceRequest binds incoming GMS service connection requests for location reporting. It validates the claimed package name with PackageUtils.getAndCheckCallingPackage(this, request.packageName); if that returns null (either no package name supplied in the GetServiceRequest or the caller's actual package does not match), an IllegalArgumentException 'Missing package name' is thrown.","triggerScenarios":"A client connects to the location reporting service with request.packageName null or empty; the caller's resolved package does not match the claimed packageName so getAndCheckCallingPackage returns null.","commonSituations":"Hand-crafted or legacy GMS client bindings that omit packageName; mismatched/impersonated package claims; outdated Google Play services client library versions building incomplete GetServiceRequests.","solutions":["Ensure the Google Play services client library sets packageName in GetServiceRequest before binding","Update the play-services client library version on the app side so the request is built correctly","Verify the calling app's manifest package matches what it passes to the API","Check PackageUtils.getAndCheckCallingPackage behavior: caller UID must actually own the claimed package"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// client side: ensure package name is populated before binding\nval req = GetServiceRequest().apply {\n    packageName = context.packageName\n    require(packageName.isNotBlank()) { \"packageName required\" }\n}","typeGuard":null,"tryCatchPattern":"try {\n    bindService(...) // connection to ReportingAndroidService\n} catch (e: IllegalArgumentException) {\n    if (e.message == \"Missing package name\") {\n        Log.e(TAG, \"GetServiceRequest.packageName not set; update play-services client library\")\n    } else throw e\n}","preventionTips":["Keep the play-services-base/location client libraries up to date so packageName is set automatically","Never hand-craft GetServiceRequest without packageName","Ensure the app's manifest package matches the identity used for GMS connections"],"tags":["android","microg","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"}