{"record":{"id":"f74ab93acc777faa","repo":"Tencent/tinker","slug":"patch-dex-file-not-found-but-path-is-null-f74ab9","errorCode":null,"errorMessage":"patch dex file not found, but path is null!!!!","messagePattern":"patch dex file not found, but path is null!!!!","errorType":"exception","errorClass":"TinkerRuntimeException","httpStatus":null,"severity":"error","filePath":"tinker-android/tinker-android-lib/src/main/java/com/tencent/tinker/lib/tinker/TinkerLoadResult.java","lineNumber":215,"sourceCode":"                        ShareConstants.TYPE_DEX, true);\n                } else {\n                    //should be not here\n                    ShareTinkerLog.e(TAG, \"patch dex file directory not found, warning why the path is null!!!!\");\n                    throw new TinkerRuntimeException(\"patch dex file directory not found, warning why the path is null!!!!\");\n                }\n                break;\n            case ShareConstants.ERROR_LOAD_PATCH_VERSION_DEX_FILE_NOT_EXIST:\n                String dexPath = ShareIntentUtil.getStringExtra(intentResult,\n                    ShareIntentUtil.INTENT_PATCH_MISSING_DEX_PATH);\n                if (dexPath != null) {\n                    //we only pass one missing file\n                    ShareTinkerLog.e(TAG, \"patch dex file not found:%s\", dexPath);\n                    tinker.getLoadReporter().onLoadFileNotFound(new File(dexPath),\n                        ShareConstants.TYPE_DEX, false);\n\n                } else {\n                    ShareTinkerLog.e(TAG, \"patch dex file not found, but path is null!!!!\");\n                    throw new TinkerRuntimeException(\"patch dex file not found, but path is null!!!!\");\n                    // tinker.getLoadReporter().onLoadFileNotFound(null,\n                    //     ShareConstants.TYPE_DEX, false);\n                }\n                break;\n            case ShareConstants.ERROR_LOAD_PATCH_VERSION_DEX_OPT_FILE_NOT_EXIST:\n                String dexOptPath = ShareIntentUtil.getStringExtra(intentResult,\n                    ShareIntentUtil.INTENT_PATCH_MISSING_DEX_PATH);\n                if (dexOptPath != null) {\n                    //we only pass one missing file\n                    ShareTinkerLog.e(TAG, \"patch dex opt file not found:%s\", dexOptPath);\n                    tinker.getLoadReporter().onLoadFileNotFound(new File(dexOptPath),\n                        ShareConstants.TYPE_DEX_OPT, false);\n\n                } else {\n                    ShareTinkerLog.e(TAG, \"patch dex opt file not found, but path is null!!!!\");\n                    throw new TinkerRuntimeException(\"patch dex opt file not found, but path is null!!!!\");\n                    // tinker.getLoadReporter().onLoadFileNotFound(null,\n                    //     ShareConstants.TYPE_DEX, false);","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/Tencent/tinker/blob/1b7ea02c239840f563ea64fb5bd286eb98d4011e/tinker-android/tinker-android-lib/src/main/java/com/tencent/tinker/lib/tinker/TinkerLoadResult.java#L197-L233","documentation":"TinkerLoadResult handles ERROR_LOAD_PATCH_VERSION_DEX_FILE_NOT_EXIST by reading the missing dex path from the intent extra INTENT_PATCH_MISSING_DEX_PATH and reporting it via onLoadFileNotFound. If that extra is absent (null), Tinker cannot tell which dex file is missing, so it throws this TinkerRuntimeException — again a defensive 'this should not happen' branch indicating the result intent was malformed or produced by mismatched loader/library versions.","triggerScenarios":"Loader returns ERROR_LOAD_PATCH_VERSION_DEX_FILE_NOT_EXIST without setting the INTENT_PATCH_MISSING_DEX_PATH string extra in the result intent. Can occur when the dex-parsing code path that raises the error forgets to attach the path, or when the intent is reconstructed/stripped by another component.","commonSituations":"Version skew between the tinker-android-loader compiled into the app and the tinker-android-lib reporting the result; ROM/vendor intent tampering; a specific dex being deleted from the patch directory after install (root tools, storage cleaners).","solutions":["Run cleanPatch() and re-apply the patch to restore a consistent dex set.","Ensure tinker-android-lib, tinker-android-loader and the gradle plugin all come from the same Tinker release version.","Check that nothing (cleanup tool, backup/restore app) deletes individual *.dex files inside /tinker/<version>/dex/.","Collect ShareTinkerLog output to identify which dex operation emitted the result code without a path."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (TinkerRuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"dex file not found, but path is null\")) {\n        Tinker.with(app).cleanPatch();\n    } else throw e;\n}","preventionTips":["Exclude the app's files/tinker dir from storage cleaners and backup tools","Pin one tinker version across all components"],"tags":["tinker","hotpatch","android","dex","missing-intent-extra"],"backgroundTag":null,"analyzedSha":"1b7ea02c239840f563ea64fb5bd286eb98d4011e","analyzedAt":"2026-08-14T15:16:52.110Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}