MuntashirAkon/AppManager · error · ApkFile.ApkFileException

No manifest found.

Error message

No manifest found.

What it means

getManifestAttributes decodes the binary AndroidManifest.xml into an XML block and expects the document element to be <manifest>; if the root element is anything else, it throws ApkFileException 'No manifest found.'

Source

Thrown at app/src/main/java/io/github/muntashirakon/AppManager/apk/ApkUtils.java:227

        return byteBuffer;
    }

    @NonNull
    public static HashMap<String, String> getManifestAttributes(@NonNull ByteBuffer manifestBytes)
            throws ApkFile.ApkFileException {
        try (BlockReader reader = new BlockReader(manifestBytes.array())) {
            HashMap<String, String> manifestAttrs = new HashMap<>();
            ResXmlDocument xmlBlock = new ResXmlDocument();
            try {
                xmlBlock.readBytes(reader);
            } catch (IOException e) {
                throw new ApkFile.ApkFileException(e);
            }
            xmlBlock.setPackageBlock(AndroidBinXmlDecoder.getFrameworkPackageBlock());
            ResXmlElement resManifestElement = xmlBlock.getDocumentElement();
            // manifest
            if (!"manifest".equals(resManifestElement.getName())) {
                throw new ApkFile.ApkFileException("No manifest found.");
            }
            Iterator<ResXmlAttribute> attrIt = resManifestElement.getAttributes();
            ResXmlAttribute attr;
            String attrName;
            while (attrIt.hasNext()) {
                attr = attrIt.next();
                attrName = attr.getName();
                if (TextUtils.isEmpty(attrName)) {
                    continue;
                }
                manifestAttrs.put(attrName, attr.getValueAsString());
            }
            // application
            ResXmlElement resApplicationElement = null;
            Iterator<ResXmlElement> resXmlElementIt = resManifestElement.getElements("application");
            if (resXmlElementIt.hasNext()) {
                resApplicationElement = resXmlElementIt.next();
            }

View on GitHub (pinned to 0152f468fc)

Solutions

  1. Verify the file/byte buffer you pass is actually AndroidManifest.xml from the APK
  2. Confirm the decoded data is binary Android XML (starts with expected AXML magic) and not plain text
  3. Check that the correct APK/split containing the manifest is used
  4. Ensure AndroidBinXmlDecoder framework package block is compatible with the APK

Example fix

// before
xmlBlock.setPackageBlock(AndroidBinXmlDecoder.getFrameworkPackageBlock());
if (!"manifest".equals(resManifestElement.getName())) { ... }
// after
ResXmlElement root = xmlBlock.getDocumentElement();
if (!"manifest".equals(root.getName())) {
    throw new ApkFile.ApkFileException("Expected AndroidManifest.xml, got root element <" + root.getName() + ">");
}
Defensive patterns

Strategy: validation

Validate before calling

// ensure the buffer is binary Android XML before decoding
static boolean isBinaryXml(byte[] data) {
    if (data == null || data.length < 4) return false;
    // AXML files start with the resource-table type header (0x00080003)
    return (data[0] == 0x03 && data[1] == 0x00 && data[2] == 0x08 && data[3] == 0x00);
}

Try / catch

try {
    return ApkUtils.getManifestAttributes(apkBuffer);
} catch (ApkFile.ApkFileException e) {
    if (e.getMessage() != null && e.getMessage().contains("No manifest")) {
        // wrong entry or non-manifest XML was decoded; re-locate AndroidManifest.xml
    }
    throw e;
}

Prevention

When it happens

Trigger: The decoded binary XML's document root element name is not 'manifest' — e.g. the buffer passed to AndroidBinXmlDecoder is not AndroidManifest.xml or is not binary Android XML at all.

Common situations: Passing a non-manifest XML resource (e.g. AndroidManifest from the wrong split, or a plain-text XML) into the decoder, framework package block mismatch corrupting resource lookups, or decoding an APK whose manifest entry resolved to a different file.

Related errors


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