{"record":{"id":"b963c60df30f6923","repo":"Tencent/tinker","slug":"bad-mimetype","errorCode":null,"errorMessage":"bad mimeType","messagePattern":"bad mimeType","errorType":"exception","errorClass":"XmlPullParserException","httpStatus":null,"severity":"error","filePath":"tinker-android/tinker-android-loader/src/main/java/com/tencent/tinker/loader/hotplug/IncrementComponentManager.java","lineNumber":494,"sourceCode":"\n            final String tagName = parser.getName();\n            if (\"action\".equals(tagName)) {\n                final String name = parser.getAttributeValue(null, \"name\");\n                if (name != null) {\n                    intentFilter.addAction(name);\n                }\n            } else if (\"category\".equals(tagName)) {\n                final String name = parser.getAttributeValue(null, \"name\");\n                if (name != null) {\n                    intentFilter.addCategory(name);\n                }\n            } else if (\"data\".equals(tagName)) {\n                final String mimeType = parser.getAttributeValue(null, \"mimeType\");\n                if (mimeType != null) {\n                    try {\n                        intentFilter.addDataType(mimeType);\n                    } catch (IntentFilter.MalformedMimeTypeException e) {\n                        throw new XmlPullParserException(\"bad mimeType\", parser, e);\n                    }\n                }\n                final String scheme = parser.getAttributeValue(null, \"scheme\");\n                if (scheme != null) {\n                    intentFilter.addDataScheme(scheme);\n                }\n                if (Build.VERSION.SDK_INT >= 19) {\n                    final String ssp = parser.getAttributeValue(null, \"ssp\");\n                    if (ssp != null) {\n                        intentFilter.addDataSchemeSpecificPart(ssp, PatternMatcher.PATTERN_LITERAL);\n                    }\n                    final String sspPrefix = parser.getAttributeValue(null, \"sspPrefix\");\n                    if (sspPrefix != null) {\n                        intentFilter.addDataSchemeSpecificPart(sspPrefix, PatternMatcher.PATTERN_PREFIX);\n                    }\n                    final String sspPattern = parser.getAttributeValue(null, \"sspPattern\");\n                    if (sspPattern != null) {\n                        intentFilter.addDataSchemeSpecificPart(sspPattern, PatternMatcher.PATTERN_SIMPLE_GLOB);","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/Tencent/tinker/blob/1b7ea02c239840f563ea64fb5bd286eb98d4011e/tinker-android/tinker-android-loader/src/main/java/com/tencent/tinker/loader/hotplug/IncrementComponentManager.java#L476-L512","documentation":"While parsing <data> elements of an incremental component's intent-filter, IntentFilter.addDataType(mimeType) threw MalformedMimeTypeException, which Tinker rethrows as XmlPullParserException('bad mimeType'). The patched manifest declares a mimeType string the framework refuses (must be type/subtype with optional wildcards).","triggerScenarios":"A <data android:mimeType=...> value like 'text', '*/*extra', or containing spaces/invalid characters inside the incremental component manifest.","commonSituations":"Typos in the AndroidManifest of the dynamic/incremental component; copy-paste from docs producing malformed values; case/whitespace issues.","solutions":["Fix the mimeType in the source manifest to a valid 'type/subtype' (wildcards only as '*/*' or 'type/*').","Rebuild and re-publish the patch after correcting the component manifest."],"exampleFix":"<!-- before -->\n<data android:mimeType=\"application\"/>\n<!-- after -->\n<data android:mimeType=\"application/json\"/>","handlingStrategy":"validation","validationCode":"// Validate mimeTypes of increment components before publishing\nprivate static boolean validMime(String m) {\n    return m != null && m.matches(\"[\\\\w.+-]+/[\\\\w.+-]+\");\n}\nfor (String m : componentMimeTypes) if (!validMime(m)) failBuild();","typeGuard":null,"tryCatchPattern":"try {\n    intentFilter.addDataType(mimeType);\n} catch (IntentFilter.MalformedMimeTypeException e) {\n    // log with the offending value and reject the patch build\n}","preventionTips":["Lint intent-filter <data> entries in dynamic-component manifests at build time.","Use only type/subtype forms; wildcard only as '*/*' or 'type/*'.","Test component manifests on a real device load before publishing the patch."],"tags":["android","manifest","intent-filter","mimetype","hotplug"],"backgroundTag":null,"analyzedSha":"1b7ea02c239840f563ea64fb5bd286eb98d4011e","analyzedAt":"2026-08-14T15:16:52.110Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}