{"record":{"id":"3bc5e158bac6c27a","repo":"Tencent/matrix","slug":"sdkversion-is-absent-in-result-info","errorCode":null,"errorMessage":"sdkVersion is absent in result.info.","messagePattern":"sdkVersion 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":224,"sourceCode":"            String confLine = null;\n            while ((confLine = br.readLine()) != null) {\n                if (confLine.startsWith(\"#\")) {\n                    // Skip comment.\n                    continue;\n                }\n                final String[] kvPair = confLine.split(\"\\\\s*=\\\\s*\");\n                if (kvPair.length != 2) {\n                    // Skip bad config line.\n                    continue;\n                }\n                final String key = kvPair[0].trim();\n                final String value = kvPair[1].trim();\n                resultInfoMap.put(key, value);\n            }\n\n            final String sdkVersionStr = resultInfoMap.get(\"sdkVersion\");\n            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            }","sourceCodeStart":206,"sourceCodeEnd":242,"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#L206-L242","documentation":"CLIMain.doAnalyze parses the result.info file inside the hprof zip bundle into a key/value map and requires the 'sdkVersion' key to convert it to an int. If the key is missing, the analyzer cannot determine how to parse the heap dump and aborts with IllegalStateException. This is an input-format contract of the Matrix resource-canary report bundle, not an Android SDK version problem per se.","triggerScenarios":"Running the analyzer CLI on a result zip whose result.info lacks the sdkVersion line, or the line is misspelled/malformed (not key=value).","commonSituations":"Hand-crafted or tool-modified hprof bundles; results generated by an older Matrix version with a different result.info schema; the zip was truncated so result.info is incomplete.","solutions":["Regenerate the result bundle with the Matrix version that matches this analyzer so result.info contains sdkVersion=<int>","Open the zip's result.info and add the missing 'sdkVersion=<int>' line","Verify the correct file is passed: the zip must contain result.info at the expected entry"],"exampleFix":"// before (result.info)\nmanufacturer=Google\n// after (result.info)\nsdkVersion=33\nmanufacturer=Google","handlingStrategy":"validation","validationCode":"Map<String,String> info = readResultInfo(zip);\nif (!info.containsKey(\"sdkVersion\")) throw new IllegalArgumentException(\"result.info missing sdkVersion\");\nInteger.parseInt(info.get(\"sdkVersion\"));","typeGuard":"null","tryCatchPattern":"try { doAnalyze(args); } catch (IllegalStateException e) { System.err.println(\"Invalid result bundle: \" + e.getMessage()); System.exit(1); }","preventionTips":["Always generate result bundles with a Matrix version matching the analyzer CLI","Never hand-edit result.info without keeping all required keys","Validate zip contents (result.info keys) before running the analyzer"],"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"}