{"record":{"id":"1f0fa33bc1a73cb3","repo":"microg/GmsCore","slug":"missing-package-name-1f0fa3","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/firebase/dynamiclinks/DynamicLinksService.kt","lineNumber":41,"sourceCode":"import com.google.firebase.dynamiclinks.internal.ShortDynamicLinkImpl\nimport com.google.firebase.dynamiclinks.internal.WarningImpl\nimport kotlinx.coroutines.Dispatchers\nimport kotlinx.coroutines.withContext\nimport org.microg.gms.BaseService\nimport org.microg.gms.common.GmsService\nimport org.microg.gms.common.PackageUtils\nimport org.microg.gms.fido.core.map\nimport org.microg.gms.appinivite.utils.DynamicLinkUtils\nimport org.microg.gms.utils.singleInstanceOf\nimport org.microg.gms.utils.warnOnTransactionIssues\nimport java.net.URLEncoder\n\nprivate const val TAG = \"DynamicLinksService\"\n\nclass DynamicLinksService : BaseService(TAG, GmsService.DYNAMIC_LINKS_API) {\n\n    override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) {\n        val callingPackage = PackageUtils.getAndCheckCallingPackage(this, request.packageName) ?: throw IllegalArgumentException(\"Missing package name\")\n        callback.onPostInitComplete(0, DynamicLinksServiceImpl(this, callingPackage, lifecycle, request.extras), null)\n    }\n\n}\n\nclass DynamicLinksServiceImpl(private val context: Context, private val callingPackageName: String, override val lifecycle: Lifecycle, extras: Bundle?) : IDynamicLinksService.Stub(), LifecycleOwner {\n\n    private val queue = singleInstanceOf { Volley.newRequestQueue(context) }\n\n    override fun getDynamicLink(callback: IDynamicLinksCallbacks, link: String?) {\n        Log.d(TAG, \"getDynamicLink: callingPackageName: $callingPackageName link: $link\")\n        lifecycleScope.launchWhenCreated {\n            try {\n                if (link == null) {\n                    throw RuntimeException(\"Missing link\")\n                }\n                val linkUri = Uri.parse(link)\n                if (\"http\" == linkUri.scheme || \"https\" == linkUri.scheme) {","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-core/src/main/kotlin/org/microg/gms/firebase/dynamiclinks/DynamicLinksService.kt#L23-L59","documentation":"DynamicLinksService checks the caller's package with PackageUtils.getAndCheckCallingPackage before instantiating DynamicLinksServiceImpl. A null result means the request's package name is missing or unverifiable, so IllegalArgumentException(\"Missing package name\") is thrown and the Dynamic Links API is not bound.","triggerScenarios":"Binding to GmsService.DYNAMIC_LINKS_API with a GetServiceRequest whose packageName is null, or a caller whose UID cannot be matched to the claimed package.","commonSituations":"Client SDK not setting the package name in the service request; spoofed/impersonated bind attempts rejected by the check; app running under a shared UID or instrumentation where the calling package cannot be resolved.","solutions":["Pass the correct packageName in GetServiceRequest when binding","Use the official/microG DynamicLinks client wrapper, which fills the request properly","Check that the calling app is installed and its UID maps to the claimed package"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"require(request.packageName != null) { \"packageName required for DynamicLinksService bind\" }","typeGuard":null,"tryCatchPattern":"try {\n  dynamicLinksClient.connect()\n} catch (e: IllegalArgumentException) {\n  if (e.message == \"Missing package name\") logBindFailure()\n}","preventionTips":["Set packageName on GetServiceRequest before onPostInitComplete","Use official client wrappers for Dynamic Links","Ensure the calling app is installed and UID-resolvable"],"tags":["dynamic-links","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"}