{"record":{"id":"94afaf8392a48d35","repo":"Tencent/matrix","slug":"leakedactivitykey-is-absent-in-result-info","errorCode":null,"errorMessage":"leakedActivityKey is absent in result.info.","messagePattern":"leakedActivityKey is absent in result\\.info\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"matrix/matrix-android/matrix-resource-canary/matrix-resource-canary-analyzer-cli/src/main/java/com/tencent/matrix/resource/analyzer/CLIMain.java","lineNumber":241,"sourceCode":"            if (sdkVersionStr == null) {\n                throw new IllegalStateException(\"sdkVersion is absent in result.info.\");\n            }\n            final int sdkVersion = Integer.parseInt(sdkVersionStr);\n\n            final String manufacturer = resultInfoMap.get(\"manufacturer\");\n            if (manufacturer == null) {\n                throw new IllegalStateException(\"manufacturer is absent in result.info.\");\n            }\n\n            final String hprofEntryName = resultInfoMap.get(\"hprofEntry\");\n            if (hprofEntryName == null) {\n                throw new IllegalStateException(\"hprofEntry is absent in result.info.\");\n            }\n            final ZipEntry hprofEntry = new ZipEntry(hprofEntryName);\n\n            final String leakedActivityKey = resultInfoMap.get(\"leakedActivityKey\");\n            if (leakedActivityKey == null) {\n                throw new IllegalStateException(\"leakedActivityKey is absent in result.info.\");\n            }\n\n            // We would extract hprof entry into a temporary file.\n            tempHprofFile = new File(new File(\"\").getAbsoluteFile(), \"temp_\" + System.currentTimeMillis() + \".hprof\");\n            StreamUtil.extractZipEntry(zf, hprofEntry, tempHprofFile);\n\n            // Parse extra info if exists.\n            final JSONObject extraInfo = new JSONObject();\n            final ZipEntry extraInfoEntry = zf.getEntry(EXTRA_INFO_NAME);\n            if (extraInfoEntry != null) {\n                BufferedReader br2 = null;\n                try {\n                    br2 = new BufferedReader(new InputStreamReader(zf.getInputStream(extraInfoEntry)));\n                    String line = null;\n                    while ((line = br2.readLine()) != null) {\n                        if (line.startsWith(\"#\")) {\n                            // Skip comment.\n                            continue;","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-resource-canary/matrix-resource-canary-analyzer-cli/src/main/java/com/tencent/matrix/resource/analyzer/CLIMain.java#L223-L259","documentation":"CLIMain.doAnalyze reads the 'leakedActivityKey' from result.info, which identifies which Activity instance leaked and is used to match instances in the heap dump. Without it, analysis results cannot be correlated, so it throws IllegalStateException.","triggerScenarios":"The result zip's result.info is missing the 'leakedActivityKey' entry (missing line, typo, or bundle produced by incompatible tooling).","commonSituations":"Hand-edited result.info files; bundles from older Matrix versions without this field; partially overwritten zips.","solutions":["Regenerate the result bundle with a matching Matrix version so leakedActivityKey is written","Add 'leakedActivityKey=<value>' to result.info inside the zip (value as produced by the on-device reporter)","Verify key spelling and that result.info was fully written into the zip"],"exampleFix":"// before (result.info)\nhprofEntry=dump.hprof\n// after (result.info)\nhprofEntry=dump.hprof\nleakedActivityKey=android.app.Activity@12345","handlingStrategy":"validation","validationCode":"if (!info.containsKey(\"leakedActivityKey\")) throw new IllegalArgumentException(\"result.info missing leakedActivityKey\");","typeGuard":"null","tryCatchPattern":"try { doAnalyze(args); } catch (IllegalStateException e) { System.err.println(\"Invalid result bundle: \" + e.getMessage()); System.exit(1); }","preventionTips":["Bundle the full result.info as emitted by the device reporter","Version-check producer and analyzer Matrix versions before analysis"],"tags":["cli","heap-dump","missing-config-field"],"backgroundTag":"missing-required-config-field","analyzedSha":"3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7","analyzedAt":"2026-09-08T08:01:39.722Z","contentChangedAt":"2026-09-08T08:01:39.722Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}