Tencent/matrix · error · IllegalStateException

sdkVersion is absent in result.info.

Error message

sdkVersion is absent in result.info.

What it means

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.

Solutions

  1. Regenerate the result bundle with the Matrix version that matches this analyzer so result.info contains sdkVersion=<int>
  2. Open the zip's result.info and add the missing 'sdkVersion=<int>' line
  3. Verify the correct file is passed: the zip must contain result.info at the expected entry

Example fix

// before (result.info)
manufacturer=Google
// after (result.info)
sdkVersion=33
manufacturer=Google
Defensive patterns

Strategy: validation

Validate before calling

Map<String,String> info = readResultInfo(zip);
if (!info.containsKey("sdkVersion")) throw new IllegalArgumentException("result.info missing sdkVersion");
Integer.parseInt(info.get("sdkVersion"));

Type guard

null

Try / catch

try { doAnalyze(args); } catch (IllegalStateException e) { System.err.println("Invalid result bundle: " + e.getMessage()); System.exit(1); }

Prevention

When it happens

Trigger: Running the analyzer CLI on a result zip whose result.info lacks the sdkVersion line, or the line is misspelled/malformed (not key=value).

Common situations: 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.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of Tencent/matrix@3b8293bd65 (2026-09-08). Data as JSON: /api/errors/3bc5e158bac6c27a. Report an issue: GitHub.

Appendix: source

Thrown at matrix/matrix-android/matrix-resource-canary/matrix-resource-canary-analyzer-cli/src/main/java/com/tencent/matrix/resource/analyzer/CLIMain.java:224

            String confLine = null;
            while ((confLine = br.readLine()) != null) {
                if (confLine.startsWith("#")) {
                    // Skip comment.
                    continue;
                }
                final String[] kvPair = confLine.split("\\s*=\\s*");
                if (kvPair.length != 2) {
                    // Skip bad config line.
                    continue;
                }
                final String key = kvPair[0].trim();
                final String value = kvPair[1].trim();
                resultInfoMap.put(key, value);
            }

            final String sdkVersionStr = resultInfoMap.get("sdkVersion");
            if (sdkVersionStr == null) {
                throw new IllegalStateException("sdkVersion is absent in result.info.");
            }
            final int sdkVersion = Integer.parseInt(sdkVersionStr);

            final String manufacturer = resultInfoMap.get("manufacturer");
            if (manufacturer == null) {
                throw new IllegalStateException("manufacturer is absent in result.info.");
            }

            final String hprofEntryName = resultInfoMap.get("hprofEntry");
            if (hprofEntryName == null) {
                throw new IllegalStateException("hprofEntry is absent in result.info.");
            }
            final ZipEntry hprofEntry = new ZipEntry(hprofEntryName);

            final String leakedActivityKey = resultInfoMap.get("leakedActivityKey");
            if (leakedActivityKey == null) {
                throw new IllegalStateException("leakedActivityKey is absent in result.info.");
            }

View on GitHub (pinned to 3b8293bd65)