Tencent/tinker · error · TinkerRuntimeException

patch dex opt file not found, but path is null!!!!

Error message

patch dex opt file not found, but path is null!!!!

What it means

Error "patch dex opt file not found, but path is null!!!!" thrown in Tencent/tinker.

Source

Thrown at tinker-android/tinker-android-lib-no-op/src/main/java/com/tencent/tinker/lib/tinker/TinkerLoadResult.java:230

                } else {
                    ShareTinkerLog.e(TAG, "patch dex file not found, but path is null!!!!");
                    throw new TinkerRuntimeException("patch dex file not found, but path is null!!!!");
                    // tinker.getLoadReporter().onLoadFileNotFound(null,
                    //     ShareConstants.TYPE_DEX, false);
                }
                break;
            case ShareConstants.ERROR_LOAD_PATCH_VERSION_DEX_OPT_FILE_NOT_EXIST:
                String dexOptPath = ShareIntentUtil.getStringExtra(intentResult,
                    ShareIntentUtil.INTENT_PATCH_MISSING_DEX_PATH);
                if (dexOptPath != null) {
                    //we only pass one missing file
                    ShareTinkerLog.e(TAG, "patch dex opt file not found:%s", dexOptPath);
                    tinker.getLoadReporter().onLoadFileNotFound(new File(dexOptPath),
                        ShareConstants.TYPE_DEX_OPT, false);

                } else {
                    ShareTinkerLog.e(TAG, "patch dex opt file not found, but path is null!!!!");
                    throw new TinkerRuntimeException("patch dex opt file not found, but path is null!!!!");
                    // tinker.getLoadReporter().onLoadFileNotFound(null,
                    //     ShareConstants.TYPE_DEX, false);
                }
                break;
            case ShareConstants.ERROR_LOAD_PATCH_VERSION_LIB_DIRECTORY_NOT_EXIST:
                if (patchVersionDirectory != null) {
                    ShareTinkerLog.e(TAG, "patch lib file directory not found:%s", libraryDirectory.getAbsolutePath());
                    tinker.getLoadReporter().onLoadFileNotFound(libraryDirectory,
                        ShareConstants.TYPE_LIBRARY, true);
                } else {
                    //should be not here
                    ShareTinkerLog.e(TAG, "patch lib file directory not found, warning why the path is null!!!!");
                    throw new TinkerRuntimeException("patch lib file directory not found, warning why the path is null!!!!");

                    // tinker.getLoadReporter().onLoadFileNotFound(null,
                    //     ShareConstants.TYPE_LIBRARY, true);
                }

View on GitHub (pinned to 1b7ea02c23)

Solutions

  1. Ensure the optimized dex (odex) output directory is writable so dex optimization can produce its files.
  2. Re-trigger patch load so the dex optimization step reruns and regenerates the missing opt file.

When it happens

Trigger: Thrown at tinker-android/tinker-android-lib-no-op/src/main/java/com/tencent/tinker/lib/tinker/TinkerLoadResult.java:230 when the library encounters an invalid state.

Common situations: Thrown in TinkerLoadResult.parseTinkerResult on ERROR_LOAD_PATCH_VERSION_DEX_OPT_FILE_NOT_EXIST when the missing-dex path extra is null. Indicates dex optimization output was cleaned or failed silently.


AI-assisted analysis of Tencent/tinker@1b7ea02c23 (2026-08-14). Data as JSON: /api/errors/3ef6f061a0841e6f. Report an issue: GitHub.