MuntashirAkon/AppManager · error · IOException
"<componentElement.getName()>" does not have required attri
Error message
"<componentElement.getName()>" does not have required attribute "android:name".
What it means
parseComponentInfo requires every component element (activity, service, receiver, provider) to carry the android:name attribute, since it is used to build the ComponentName. When getAttributeValue returns null the parser throws instead of producing a component with a null name.
Source
Thrown at app/src/main/java/io/github/muntashirakon/AppManager/apk/parser/ManifestParser.java:114
case TAG_ACTIVITY:
case TAG_ACTIVITY_ALIAS:
case TAG_SERVICE:
case TAG_RECEIVER:
case TAG_PROVIDER:
componentIfList.add(parseComponentInfo(elem));
break;
}
}
}
return componentIfList;
}
}
@NonNull
private ManifestComponent parseComponentInfo(@NonNull ResXmlElement componentElement) throws IOException {
String componentName = getAttributeValue(componentElement, ATTR_NAME);
if (componentName == null) {
throw new IOException("\"" + componentElement.getName() + "\" does not have required attribute \"android:name\".");
}
ManifestComponent componentIf = new ManifestComponent(new ComponentName(mPackageName, componentName));
// manifest -> application -> component -> intent-filter
Iterator<ResXmlElement> resXmlElementIt = componentElement.getElements(TAG_INTENT_FILTER);
while (resXmlElementIt.hasNext()) {
ResXmlElement elem = resXmlElementIt.next();
componentIf.intentFilters.add(parseIntentFilter(elem));
}
return componentIf;
}
@NonNull
private ManifestIntentFilter parseIntentFilter(@NonNull ResXmlElement intentFilterElement) {
ManifestIntentFilter intentFilter = new ManifestIntentFilter();
String priorityString = getAttributeValue(intentFilterElement, ATTR_PRIORITY);
if (priorityString != null) {
intentFilter.priority = Integer.parseInt(priorityString);
}View on GitHub (pinned to 0152f468fc)
Solutions
- Open the manifest (aapt dump xmltree) and add android:name to the offending component, then rebuild
- Remove the incomplete component element from AndroidManifest.xml
- Rebuild from source ensuring manifest merger does not drop android:name
- Skip/flag such APKs as malformed before analysis
Example fix
// before <activity android:exported="true" android:permission="..." /> // after <activity android:name="com.example.Main" android:exported="true" />
Defensive patterns
Strategy: try-catch
Validate before calling
// aapt dump xmltree app.apk AndroidManifest.xml // confirm every activity/service/receiver/provider node has android:name
Type guard
boolean componentHasName(ResXmlElement el) {
return getAttributeValue(el, "name") != null; // mirrors parser's ATTR_NAME lookup
} Try / catch
try {
comps = parser.manifestComponents();
} catch (IOException e) {
if (e.getMessage().contains("required attribute \"android:name\"")) {
Log.w(TAG, "Skipping malformed component manifest");
}
} Prevention
- Keep android:name on all manifest components
- Review manifest merger output in CI
- Avoid stripping manifest attributes with obfuscation tools
When it happens
Trigger: Calling parseComponents on a manifest where an <activity>/<service>/<receiver>/<provider> element inside <application> lacks android:name; componentElement.getName() is interpolated into the message.
Common situations: Hand-edited or badly merged manifests, obfuscation tools stripping attributes, corrupted binary XML, custom component tags missing required attributes.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- "manifest" does not have required attribute "package".
- "manifest" has duplicate "application" tags.
- "manifest" has duplicate "application" tags.
- "manifest" tag not found.
- Failed to read AndroidManifest.xml
AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12).
Data as JSON: /api/errors/56ebfb6c123594f3.
Report an issue: GitHub.