{"record":{"id":"969df08537c7f981","repo":"microg/GmsCore","slug":"missing-package-name-969df0","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/findmydevice/spot/management/ManagementService.kt","lineNumber":43,"sourceCode":"import com.google.android.gms.findmydevice.spot.ImportGivenOwnerKeyRequest\nimport com.google.android.gms.findmydevice.spot.ImportRequiredOwnerKeysRequest\nimport com.google.android.gms.findmydevice.spot.SetOwnerKeyRequest\nimport com.google.android.gms.findmydevice.spot.SyncOwnerKeyRequest\nimport com.google.android.gms.findmydevice.spot.internal.ISpotManagementCallbacks\nimport com.google.android.gms.findmydevice.spot.internal.ISpotManagementService\nimport org.microg.gms.BaseService\nimport org.microg.gms.auth.AuthPrefs\nimport org.microg.gms.common.GmsService\nimport org.microg.gms.common.PackageUtils\nimport org.microg.gms.findmydevice.FEATURES\nimport org.microg.gms.utils.warnOnTransactionIssues\n\nprivate const val TAG = \"ManagementService\"\n\nclass ManagementService : BaseService(TAG, GmsService.FIND_MY_DEVICE_SPOT) {\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        val spotManagementServiceImpl = SpotManagementServiceImpl(packageName, this, lifecycle)\n        callback.onPostInitCompleteWithConnectionInfo(0, spotManagementServiceImpl.asBinder(), ConnectionInfo().apply {\n            features = FEATURES\n        })\n    }\n}\n\nclass SpotManagementServiceImpl(val packageName: String, val context: Context, override val lifecycle: Lifecycle) : ISpotManagementService.Stub(), LifecycleOwner {\n\n    override fun getOwnerKey(callbacks: ISpotManagementCallbacks?, request: GetOwnerKeyRequest?) {\n        Log.d(TAG, \"Unimplement getOwnerKey: $request\")\n    }\n\n    override fun setOwnerKey(callbacks: ISpotManagementCallbacks?, request: SetOwnerKeyRequest?) {\n        Log.d(TAG, \"Unimplement setOwnerKey: $request\")\n    }\n\n    override fun importRequiredOwnerKeys(","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-core/src/main/kotlin/org/microg/gms/findmydevice/spot/management/ManagementService.kt#L25-L61","documentation":"ManagementService (Find My Device spot management) validates the requesting app's package in handleServiceRequest via PackageUtils.getAndCheckCallingPackage. If the resolved/verified calling package is null, it throws IllegalArgumentException(\"Missing package name\") and refuses to bind the SpotManagement service implementation.","triggerScenarios":"A client binds to the FIND_MY_DEVICE_SPOT GmsService with a GetServiceRequest whose packageName is null or does not match the actual calling UID so getAndCheckCallingPackage returns null.","commonSituations":"Malformed or spoofed GetServiceRequest from a non-Google client; calling through a binder shim that drops the package name; testing the service directly without setting request.packageName.","solutions":["Set request.packageName to the caller's real package name before binding","Ensure the calling app's package/UID is resolvable by the package manager (app actually installed, not a shell UID)","If building a client, use the standard GmsClient bind path which populates the request correctly"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// client side, before binding\nrequire(request.packageName != null) { \"GetServiceRequest.packageName must be set\" }","typeGuard":null,"tryCatchPattern":"try {\n  managementClient.connect()\n} catch (e: IllegalArgumentException) {\n  if (e.message == \"Missing package name\") fixRequestPackageName()\n}","preventionTips":["Always populate GetServiceRequest.packageName from context.packageName","Use the standard GmsClient bind helpers instead of raw binds","Avoid shared UIDs/instrumentation contexts when binding GmsServices"],"tags":["find-my-device","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-14T00:17:10.932Z"}