{"record":{"id":"92ce089522dc6ede","repo":"microg/GmsCore","slug":"missing-package-name-92ce08","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/manager/LocationManagerService.kt","lineNumber":49,"sourceCode":"            val location = intent.getParcelableExtra<Location>(EXTRA_LOCATION)\n            if (location != null) {\n                locationManager.updateNetworkLocation(location)\n            }\n        }\n        if (intent != null && IntentCacheManager.isCache(intent)) {\n            locationManager.handleCacheIntent(intent)\n        }\n        return super.onStartCommand(intent, flags, startId)\n    }\n\n    override fun onDestroy() {\n        locationManager.stop()\n        super.onDestroy()\n    }\n\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        locationManager.start()\n        callback.onPostInitCompleteWithConnectionInfo(\n            CommonStatusCodes.SUCCESS,\n            LocationManagerInstance(this, locationManager, packageName, lifecycle).asBinder(),\n            ConnectionInfo().apply { features = FEATURES }\n        )\n    }\n\n    override fun dump(fd: FileDescriptor?, writer: PrintWriter, args: Array<out String>?) {\n        super.dump(fd, writer, args)\n        locationManager.dump(writer)\n    }\n\n    companion object {\n        const val ACTION_REPORT_LOCATION = \"org.microg.gms.location.manager.ACTION_REPORT_LOCATION\"\n    }\n}","sourceCodeStart":31,"sourceCodeEnd":66,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/LocationManagerService.kt#L31-L66","documentation":"LocationManagerService.handleServiceRequest throws IllegalArgumentException('Missing package name') when PackageUtils.getAndCheckCallingPackage returns null — i.e. the GetServiceRequest carried no/blank packageName, or the calling package could not be resolved/verified against the actual binder caller. microG requires a verified client package name before handing out the location binder.","triggerScenarios":"Binding to the location service with a GetServiceRequest whose packageName field is null or empty; calling from a process whose package cannot be resolved (e.g. shared-uid isolation contexts, instrumentation, or spoofed package name that fails PackageUtils verification).","commonSituations":"Client SDK builds the GetServiceRequest without setting the app package name; running under a test runner with an unusual uid; custom ROM/clone apps with mismatched package metadata; microG unable to resolve calling package because of work-profile isolation.","solutions":["Ensure the GMS client is created with a valid context so the request packageName is populated with the app's real package.","Check that the app's package name resolves: adb shell pm list packages | grep <pkg>; reinstall if missing.","Update the play-services-base client / microG versions so package verification (getAndCheckCallingPackage) succeeds."],"exampleFix":"// before\n// request built manually without packageName\nGetServiceRequest().apply { services = ... }\n// after\nGetServiceRequest().apply {\n    packageName = context.packageName // real, resolvable package\n    services = ...\n}","handlingStrategy":"try-catch","validationCode":"val name = PackageUtils.getAndCheckCallingPackage(context, request.packageName)\nrequireNotNull(name) { \"Calling package could not be verified\" }","typeGuard":"fun hasVerifiedPackageName(ctx: Context, claimed: String?): Boolean =\n    !claimed.isNullOrBlank() && runCatching { ctx.packageManager.getPackageInfo(claimed, 0) }.isSuccess","tryCatchPattern":"try {\n    bindLocationService(request)\n} catch (e: IllegalArgumentException) {\n    if (e.message == \"Missing package name\") {\n        // rebuild request with context.packageName and retry binding\n    }\n}","preventionTips":["Always create GMS clients from a real Activity/Application context","Never construct GetServiceRequest manually without packageName","Ensure the app's package resolves via PackageManager before binding"],"tags":["illegal-argument","binding","package-name","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-14T00:17:10.932Z"}