Tencent/tinker · critical · TinkerRuntimeException
res meta Corrupted:{}
Error message
res meta Corrupted:{} What it means
ShareResPatchInfo.parseResPatchInfoFirstLine parses the first line of the res-meta entry from the patch's meta file. It splits the first line on ',' with limit 3 and assigns kv[1] to arscBaseCrc and kv[2] to resArscMd5. If the meta is non-null but its first line is empty, TinkerRuntimeException('res meta Corrupted:<meta>') is thrown — the resource-patch metadata cannot be interpreted. (Note: fewer than 3 comma-separated parts would instead surface as ArrayIndexOutOfBoundsException.)
Source
Thrown at tinker-android/tinker-android-loader-no-op/src/main/java/com/tencent/tinker/loader/shareutil/ShareResPatchInfo.java:161
if (input.contains("?")) {
input = input.replaceAll("\\?", "\\.");
}
//convert * to.*
if (input.contains("*")) {
input = input.replace("*", ".*");
}
Pattern pattern = Pattern.compile(input);
return pattern;
}
public static void parseResPatchInfoFirstLine(String meta, ShareResPatchInfo info) {
if (meta == null || meta.length() == 0) {
return;
}
String[] lines = meta.split("\n");
String firstLine = lines[0];
if (firstLine == null || firstLine.length() <= 0) {
throw new TinkerRuntimeException("res meta Corrupted:" + meta);
}
final String[] kv = firstLine.split(",", 3);
info.arscBaseCrc = kv[1];
info.resArscMd5 = kv[2];
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("resArscMd5:" + resArscMd5 + "\n");
sb.append("arscBaseCrc:" + arscBaseCrc + "\n");
for (Pattern pattern : patterns) {
sb.append("pattern:" + pattern + "\n");
}
for (String add : addRes) {
sb.append("addedSet:" + add + "\n");
}View on GitHub (pinned to 1b7ea02c23)
Solutions
- Rebuild the patch with the tinker gradle plugin version matching the loader SDK, and verify the meta.txt res line starts with the expected 'res,<crc>,<md5>' triple.
- Validate the patch package (md5 of the whole zip) before applying so corrupted downloads never reach parsing.
- If you construct the meta string yourself, ensure line 1 is the non-empty header line and later lines carry the entries.
- Upgrade both tinker gradle plugin and android SDK together from the same release.
Example fix
// before
info.arscBaseCrc = kv[1];
info.resArscMd5 = kv[2];
// after
final String[] kv = firstLine.split(",", 3);
if (kv.length < 3) {
throw new TinkerRuntimeException("res meta Corrupted:" + meta);
}
info.arscBaseCrc = kv[1];
info.resArscMd5 = kv[2]; Defensive patterns
Strategy: validation
Validate before calling
String[] parts = firstLine == null ? null : firstLine.split(",", 3);
if (parts == null || parts.length < 3 || firstLine.isEmpty()) {
// refuse to parse: malformed res meta
} Try / catch
catch TinkerRuntimeException 'res meta Corrupted' -> reject the patch package and request a rebuilt one
Prevention
- Build patches with gradle plugin and loader SDK from the same tinker release.
- Verify patch zip md5 before apply so corrupted meta never reaches the parser.
- Never hand-edit or re-zip patch packages after signing.
When it happens
Trigger: meta string whose first line (before the first \n) is empty — e.g. a leading newline in the res entry of meta.txt; a res-meta line built by a mismatched/old patch-build tool; manual editing of the package breaking the 'res,' prefix line format.
Common situations: Patch built with an old tinker gradle plugin but loaded with a newer loader (or vice versa); corrupted patch download; resource-only patches where the res meta line was malformed during packaging.
Related errors
AI-assisted analysis of Tencent/tinker@1b7ea02c23 (2026-08-14).
Data as JSON: /api/errors/c8c626f351412c00.
Report an issue: GitHub.