iBotPeaches/Apktool · error · AndrolibException
Missing type string pool.
Error message
Missing type string pool.
What it means
parseTypeSpec requires the package's type-name string pool to be loaded before any RES_TABLE_TYPE_SPEC chunk can be interpreted (it maps the spec's type id to a name via `mTypeStringPool.getString(id - 1)`). If a type spec chunk appears before the RES_TABLE_TYPE_TYPE string-pool chunk in the package, this error is thrown.
Source
Thrown at brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/BinaryResourceParser.java:303
break;
default:
skipUnexpectedChunk(parser);
break;
}
}
// Clean up.
injectDummyEntrySpecs();
mInvalidConfigs.clear();
mPackage = null;
mTypeIdOffset = 0;
mTypeStringPool = null;
mKeyStringPool = null;
}
private void parseTypeSpec(ResChunkPullParser parser) throws AndrolibException, IOException {
if (mTypeStringPool == null) {
throw new AndrolibException("Missing type string pool.");
}
// ResTable_typeSpec
int id = mIn.readUnsignedByte();
mIn.skipByte(); // res0
mIn.skipShort(); // typesCount
int entryCount = mIn.readInt();
skipUnreadHeader(parser);
if (mEntrySpecFlagsOffsets != null) {
mEntrySpecFlagsOffsets.add(Pair.of(mIn.position(), entryCount));
}
mIn.skipBytes(entryCount * 4); // flags
mPackage.addTypeSpec(id, mTypeStringPool.getString(id - 1));
}
View on GitHub (pinned to 79b63384d7)
Solutions
- Confirm the APK decodes with stock aapt2 (`aapt2 dump resources app.apk`) — if that also fails, the arsc itself is malformed.
- Get the original unobfuscated APK (different device ABI split, pre-packing source) and decode that.
- If you control the arsc generation, emit the type string pool (RES_TABLE_TYPE_TYPE) before any type spec chunks.
- Report apps protected by packers as unsupported rather than trying to hand-patch pool offsets.
Defensive patterns
Strategy: try-catch
Try / catch
try {
apkDecoder.decode(apk, out);
} catch (AndrolibException e) {
if (e.getMessage().contains("type string pool")) {
// arsc chunk order is invalid (packer/obfuscator) — try an unobfuscated source
}
} Prevention
- Treat 'string pool' errors as structural arsc damage, not as configuration bugs.
- Prefer APK sources that skip third-party packers.
- When generating arsc, keep canonical aapt2 chunk ordering.
When it happens
Trigger: Decoding an arsc where the RES_TABLE_TYPE_SPEC chunk precedes the type string pool chunk inside a package — i.e. chunk order violates the aapt2 format, typically from a corrupted, hand-edited, or packer-mangled resources.arsc.
Common situations: Resources obfuscated by third-party packers (e.g. commercial Android packers) that strip or reorder string pools; arsc patched by resource-shrinking tools with bugs; malformed arsc emitted by non-standard build tooling.
Related errors
- Missing key string pool
- Missing value string pool.
- Input file is empty.
- Unexpected chunk:
- Could not decode arsc file.
AI-assisted analysis of iBotPeaches/Apktool@79b63384d7 (2026-08-14).
Data as JSON: /api/errors/8371fa3dd56692f6.
Report an issue: GitHub.