{"record":{"id":"e551b940ec7ef84c","repo":"microg/GmsCore","slug":"integrityerrorcode-internal-error","errorCode":"IntegrityErrorCode.INTERNAL_ERROR","errorMessage":"Null packageName.","messagePattern":"Null packageName\\.","errorType":"error_code","errorClass":"StandardIntegrityException","httpStatus":null,"severity":"error","filePath":"vending-app/src/main/kotlin/com/google/android/finsky/expressintegrityservice/ExpressIntegrityService.kt","lineNumber":271,"sourceCode":"\n                visitData?.updateAppIntegrityContent(context, System.currentTimeMillis(), \"$TAG visited success.\", true)\n                callback?.onWarmResult(bundleOf(KEY_WARM_UP_SID to expressIntegritySession.sessionId))\n            }.onFailure {\n                val exception = it as? StandardIntegrityException ?: StandardIntegrityException(it.message)\n                Log.w(TAG, \"warm up has failed: code=${exception.code}, message=${exception.message}\", exception)\n                visitData?.updateAppIntegrityContent(context, System.currentTimeMillis(), \"$TAG visited failed. ${exception.message}\")\n                callback?.onWarmResult(bundleOf(KEY_ERROR to exception.code))\n            }\n        }\n    }\n\n    override fun requestExpressIntegrityToken(bundle: Bundle, callback: IExpressIntegrityServiceCallback?) {\n        Log.d(TAG, \"requestExpressIntegrityToken bundle:$bundle\")\n        lifecycleScope.launchWhenCreated {\n            runCatching {\n                val callingPackageName = bundle.getString(KEY_PACKAGE_NAME)\n                if (callingPackageName == null) {\n                    throw StandardIntegrityException(IntegrityErrorCode.INTERNAL_ERROR, \"Null packageName.\")\n                }\n                visitData = callerAppToIntegrityData(context, callingPackageName)\n                if (visitData?.allowed != true) {\n                    throw StandardIntegrityException(IntegrityErrorCode.API_NOT_AVAILABLE, \"Not allowed visit\")\n                }\n                val playIntegrityEnabled = VendingPreferences.isDeviceAttestationEnabled(context)\n                if (!playIntegrityEnabled) {\n                    throw StandardIntegrityException(IntegrityErrorCode.API_NOT_AVAILABLE, \"API is disabled\")\n                }\n\n                val expressIntegritySession = ExpressIntegritySession(\n                    packageName = callingPackageName,\n                    cloudProjectNumber = bundle.getLong(KEY_CLOUD_PROJECT, 0L),\n                    sessionId = Random.nextLong(),\n                    requestHash = bundle.getString(KEY_NONCE),\n                    originatingWarmUpSessionId = bundle.getLong(KEY_WARM_UP_SID, 0),\n                    verdictOptOut = bundle.getIntegerArrayList(KEY_REQUEST_VERDICT_OPT_OUT),\n                    webViewRequestMode = bundle.getInt(KEY_REQUEST_MODE, 0)","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/vending-app/src/main/kotlin/com/google/android/finsky/expressintegrityservice/ExpressIntegrityService.kt#L253-L289","documentation":"requestExpressIntegrityToken throws StandardIntegrityException with IntegrityErrorCode.INTERNAL_ERROR and message 'Null packageName.' when the request Bundle does not contain a package name string under KEY_PACKAGE_NAME. The service cannot identify the calling app without it, so it fails fast with an internal error code.","triggerScenarios":"Calling express integrity API with a Bundle lacking the KEY_PACKAGE_NAME string extra.","commonSituations":"Client SDK bug or version mismatch where the package name extra is never set; bundle built manually without the required key; IPC marshalling dropped the extra.","solutions":["Ensure the Play Integrity client sets the caller package name extra in the request Bundle","Use the official Play Integrity library instead of constructing the Bundle manually","Update Google Play services and the integrity client library on the device","Log the request Bundle contents to confirm which key the service expects"],"exampleFix":"// before\nval bundle = Bundle()\nintegrityManager.requestExpressIntegrityToken(bundle, callback)\n// after\nval bundle = Bundle().apply { putString(\"package.name\", context.packageName) }\nintegrityManager.requestExpressIntegrityToken(bundle, callback)","handlingStrategy":"validation","validationCode":"// caller side: ensure the package name extra is present before binding\ncheck(bundle.containsKey(\"package.name\")) { \"request Bundle missing package name\" }","typeGuard":"val packageName: String? = bundle.getString(\"package.name\")\nif (packageName.isNullOrEmpty()) return // abort before service call","tryCatchPattern":"try {\n    integrityManager.requestExpressIntegrityToken(bundle, callback)\n} catch (e: StandardIntegrityException) {\n    if (e.statusCode == IntegrityErrorCode.INTERNAL_ERROR) Log.e(TAG, \"malformed request\", e)\n}","preventionTips":["Always build request Bundles through the official Play Integrity client","Never strip or rebuild the client's request Bundle extras","Pin compatible versions of the integrity client library"],"tags":["kotlin","play-integrity","bundle","missing-argument"],"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"}