MuntashirAkon/AppManager · error · IllegalArgumentException

Bad component name

Error message

Bad component name: ${rawValue}

What it means

IntentCompat.parseExtraValue() reconstructs typed Intent extras from a flattened string form. For TYPE_COMPONENT_NAME it calls ComponentName.unflattenFromString(rawValue); a null result means the string is not of the form 'package/class', so it throws IllegalArgumentException('Bad component name: ...').

Solutions

  1. Format the value as 'full.package.name/fully.qualified.ClassName', e.g. com.example/.MainActivity
  2. Use ComponentName.flattenToString() on the source side so the value round-trips correctly
  3. Validate with ComponentName.unflattenFromString() != null before setting the extra

Example fix

// before
"com.example.MainActivity" // no package/class separator
// after
"com.example/com.example.MainActivity"
Defensive patterns

Strategy: validation

Validate before calling

if (ComponentName.unflattenFromString(rawValue) == null) {
    throw new IllegalArgumentException("Not a flattenToString() component: " + rawValue);
}

Try / catch

try {
    Object v = IntentCompat.parseExtraValue(type, rawValue);
} catch (IllegalArgumentException e) {
    Log.w(TAG, "Malformed extra value", e);
}

Prevention

When it happens

Trigger: Passing a TYPE_COMPONENT_NAME extra whose raw value lacks the required 'pkg/cls' flattening — e.g. missing slash, empty class, or malformed package.

Common situations: Hand-crafting or editing intercepted-intent strings; copying intent URIs between apps with typos; automation scripts producing invalid component strings.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12). Data as JSON: /api/errors/e59f42907128f8c3. Report an issue: GitHub.

Appendix: source

Thrown at app/src/main/java/io/github/muntashirakon/AppManager/intercept/IntentCompat.java:180

                    list[i] = Uri.parse(strings[i]);
                }
                return list;
            }
            case TYPE_URI_AL: {
                // Split on commas unless they are preceded by an escape.
                // The escape character must be escaped for the string and
                // again for the regex, thus four escape characters become one.
                String[] strings = rawValue.split("(?<!\\\\),");
                List<Uri> list = new ArrayList<>(strings.length);
                for (String s : strings) {
                    list.add(Uri.parse(s));
                }
                return list;
            }
            case TYPE_COMPONENT_NAME:
                ComponentName cn = ComponentName.unflattenFromString(rawValue);
                if (cn == null) {
                    throw new IllegalArgumentException("Bad component name: " + rawValue);
                }
                return cn;
            case TYPE_INT_ARR: {
                String[] strings = rawValue.split(",");
                int[] list = new int[strings.length];
                for (int i = 0; i < strings.length; i++) {
                    list[i] = IntegerCompat.decode(strings[i].trim());
                }
                return list;
            }
            case TYPE_INT_AL: {
                String[] strings = rawValue.split(",");
                ArrayList<Integer> list = new ArrayList<>(strings.length);
                for (String string : strings) {
                    list.add(IntegerCompat.decode(string.trim()));
                }
                return list;
            }

View on GitHub (pinned to 0152f468fc)