{"record":{"id":"1212f20f4eec52b9","repo":"Tencent/tinker","slug":"patch-resource-file-not-found-warning-why-the-pat-1212f2","errorCode":null,"errorMessage":"patch resource file not found, warning why the path is null!!!!","messagePattern":"patch resource file not found, warning why the 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":304,"sourceCode":"                if (patchVersionDirectory != null) {\n                    ShareTinkerLog.e(TAG, \"patch resource file directory not found:%s\", resourceDirectory.getAbsolutePath());\n                    tinker.getLoadReporter().onLoadFileNotFound(resourceDirectory,\n                        ShareConstants.TYPE_RESOURCE, true);\n                } else {\n                    //should be not here\n                    ShareTinkerLog.e(TAG, \"patch resource file directory not found, warning why the path is null!!!!\");\n                    throw new TinkerRuntimeException(\"patch resource file directory not found, warning why the path is null!!!!\");\n                }\n                break;\n            case ShareConstants.ERROR_LOAD_PATCH_VERSION_RESOURCE_FILE_NOT_EXIST:\n                if (patchVersionDirectory != null) {\n                    ShareTinkerLog.e(TAG, \"patch resource file not found:%s\", resourceFile.getAbsolutePath());\n                    tinker.getLoadReporter().onLoadFileNotFound(resourceFile,\n                        ShareConstants.TYPE_RESOURCE, false);\n                } else {\n                    //should be not here\n                    ShareTinkerLog.e(TAG, \"patch resource file not found, warning why the path is null!!!!\");\n                    throw new TinkerRuntimeException(\"patch resource file not found, warning why the path is null!!!!\");\n                }\n                break;\n            case ShareConstants.ERROR_LOAD_PATCH_VERSION_RESOURCE_MD5_MISMATCH:\n                if (resourceFile == null) {\n                    ShareTinkerLog.e(TAG, \"resource file md5 mismatch, but patch resource file not found!\");\n                    throw new TinkerRuntimeException(\"resource file md5 mismatch, but patch resource file not found!\");\n                }\n                ShareTinkerLog.e(TAG, \"patch resource file md5 is mismatch: %s\", resourceFile.getAbsolutePath());\n\n                tinker.getLoadReporter().onLoadFileMd5Mismatch(resourceFile,\n                    ShareConstants.TYPE_RESOURCE);\n                break;\n            case ShareConstants.ERROR_LOAD_PATCH_GET_OTA_INSTRUCTION_SET_EXCEPTION:\n                tinker.getLoadReporter().onLoadInterpret(ShareConstants.TYPE_INTERPRET_GET_INSTRUCTION_SET_ERROR, ShareIntentUtil.getIntentInterpretException(intentResult));\n                break;\n            case ShareConstants.ERROR_LOAD_PATCH_OTA_INTERPRET_ONLY_EXCEPTION:\n                tinker.getLoadReporter().onLoadInterpret(ShareConstants.TYPE_INTERPRET_COMMAND_ERROR, ShareIntentUtil.getIntentInterpretException(intentResult));\n                break;","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/Tencent/tinker/blob/1b7ea02c239840f563ea64fb5bd286eb98d4011e/tinker-android/tinker-android-lib/src/main/java/com/tencent/tinker/lib/tinker/TinkerLoadResult.java#L286-L322","documentation":"Twin of 147 for a single resource file: ERROR_LOAD_PATCH_VERSION_RESOURCE_FILE_NOT_EXIST should report the missing resources file via onLoadFileNotFound(resourceFile, TYPE_RESOURCE, false), but when patchVersionDirectory is null the path cannot be derived and Tinker throws TinkerRuntimeException. It indicates the versioned patch directory metadata became inconsistent with the loader's inspection result.","triggerScenarios":"Loader returns ERROR_LOAD_PATCH_VERSION_RESOURCE_FILE_NOT_EXIST with patchVersionDirectory null locally (patch info references a version whose directory cannot be resolved).","commonSituations":"resources_out.zip in the version directory deleted after apply; patch info corruption; concurrent cleanPatch during load.","solutions":["cleanPatch() and re-apply the patch.","Avoid concurrent patch operations across processes.","Validate no cleanup service deletes files under /tinker/.","Reproduce with tinker logs enabled to see the exact load sequence."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (TinkerRuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"resource file not found\")) {\n        Tinker.with(app).cleanPatch();\n    } else throw e;\n}","preventionTips":["Serialize patch apply/load/clean operations","Monitor onLoadFileNotFound(TYPE_RESOURCE) in your LoadReporter"],"tags":["tinker","hotpatch","android","resource","corrupted-state"],"backgroundTag":null,"analyzedSha":"1b7ea02c239840f563ea64fb5bd286eb98d4011e","analyzedAt":"2026-08-14T15:16:52.110Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}