MuntashirAkon/AppManager · error · IllegalArgumentException
Invalid filter
Error message
Invalid filter: ${filterName} What it means
FilterOptions.create(filterName) is a factory that maps a filter type name string to a concrete FilterOption subclass via a switch. If the name matches no known case, it throws IllegalArgumentException, rejecting unknown filter identifiers.
Solutions
- Use one of the exact registered names (e.g. "times_opened", "total_size", "trackers", "uid", "version_name", ...) as matched in the switch.
- Check the spelling/case of filterName against FilterOptions.create()'s cases.
- When loading persisted filters from another version, validate/normalize names and drop unknown ones before calling create().
Example fix
// before
FilterOption o = FilterOptions.create("lastmodified");
// after
FilterOption o = FilterOptions.create("last_update"); Defensive patterns
Strategy: try-catch
Validate before calling
Set<String> known = Set.of("times_opened", "total_size", "trackers", "uid", "version_name" /* ...all cases */);
if (!known.contains(filterName)) throw new IllegalArgumentException("Unknown filter: " + filterName); Try / catch
try {
option = FilterOptions.create(name);
} catch (IllegalArgumentException e) {
Log.w(TAG, "Unknown filter type, skipping", e);
option = null;
} Prevention
- Copy filter names exactly from FilterOptions.create()'s switch cases.
- Use string constants rather than inline literals for filter names.
- When importing filters from files/other versions, validate names first and skip unknown ones.
When it happens
Trigger: Calling FilterOptions.create() with a name string not in its switch (e.g. misspelled name like "targt_sdk", a name from a newer/older app version, or an arbitrary string from deserialized JSON/Parcel).
Common situations: Restoring saved filters (JSON via fromJson / Parcel via createFromParcel) written by a different app version whose filter names changed; hand-writing filter rules with a wrong type name; locale/case mistakes in the filter name.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Bad component name
- Could not mount
- Firewall overlays require Android 13+
- Flags must be returned by the corresponding subclasses. key
- Invalid boolean value
AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12).
Data as JSON: /api/errors/fb7b6757aa4ff2bb.
Report an issue: GitHub.
Appendix: source
Thrown at app/src/main/java/io/github/muntashirakon/AppManager/filters/options/FilterOptions.java:38
case "data_usage": return new DataUsageOption();
case "freeze_unfreeze": return new FreezeOption();
case "installed": return new InstalledOption();
case "installer": return new InstallerOption();
case "last_update": return new LastUpdateOption();
case "min_sdk": return new MinSdkOption();
case "permissions": return new PermissionsOption();
case "pkg_name": return new PackageNameOption();
case "running_apps": return new RunningAppsOption();
case "screen_time": return new ScreenTimeOption();
case "signature": return new SignatureOption();
case "target_sdk": return new TargetSdkOption();
case "times_opened": return new TimesOpenedOption();
case "total_size": return new TotalSizeOption();
case "trackers": return new TrackersOption();
case "uid": return new UidOption();
case "version_name": return new VersionNameOption();
}
throw new IllegalArgumentException("Invalid filter: " + filterName);
}
}
View on GitHub (pinned to 0152f468fc)