Tencent/tinker · error · TinkerRuntimeException

patch lib file not found, but path is null!!!!

Error message

patch lib file not found, but path is null!!!!

What it means

TinkerLoadResult's handler for ERROR_LOAD_PATCH_VERSION_LIB_FILE_NOT_EXIST reads the missing native library path from INTENT_PATCH_MISSING_LIB_PATH; if the extra is null it throws this TinkerRuntimeException because it cannot identify which .so file vanished. Like the dex twin (error 142) it is an internal-consistency guard, not a normal user-facing failure.

Source

Thrown at tinker-android/tinker-android-lib/src/main/java/com/tencent/tinker/lib/tinker/TinkerLoadResult.java:261

                    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);
                }

                break;
            case ShareConstants.ERROR_LOAD_PATCH_VERSION_LIB_FILE_NOT_EXIST:
                String libPath = ShareIntentUtil.getStringExtra(intentResult,
                    ShareIntentUtil.INTENT_PATCH_MISSING_LIB_PATH);
                if (libPath != null) {
                    //we only pass one missing file and then we break
                    ShareTinkerLog.e(TAG, "patch lib file not found:%s", libPath);
                    tinker.getLoadReporter().onLoadFileNotFound(new File(libPath),
                        ShareConstants.TYPE_LIBRARY, false);
                } else {
                    ShareTinkerLog.e(TAG, "patch lib file not found, but path is null!!!!");
                    throw new TinkerRuntimeException("patch lib file not found, but path is null!!!!");
                    // tinker.getLoadReporter().onLoadFileNotFound(null,
                    //     ShareConstants.TYPE_LIBRARY, false);
                }
                break;
            case ShareConstants.ERROR_LOAD_PATCH_VERSION_DEX_CLASSLOADER_NULL:
                ShareTinkerLog.e(TAG, "patch dex load fail, classloader is null");
                break;
            case ShareConstants.ERROR_LOAD_PATCH_VERSION_DEX_MD5_MISMATCH:
                String mismatchPath = ShareIntentUtil.getStringExtra(intentResult,
                    ShareIntentUtil.INTENT_PATCH_MISMATCH_DEX_PATH);
                if (mismatchPath == null) {
                    ShareTinkerLog.e(TAG, "patch dex file md5 is mismatch, but path is null!!!!");
                    throw new TinkerRuntimeException("patch dex file md5 is mismatch, but path is null!!!!");
                } else {
                    ShareTinkerLog.e(TAG, "patch dex file md5 is mismatch: %s", mismatchPath);
                    tinker.getLoadReporter().onLoadFileMd5Mismatch(new File(mismatchPath),
                        ShareConstants.TYPE_DEX);
                }

View on GitHub (pinned to 1b7ea02c23)

Solutions

  1. cleanPatch() and re-apply the patch.
  2. Make sure the patch package includes .so files for every ABI your base APK ships (tinker only patches libs present in both).
  3. Pin all tinker artifacts to one version.
  4. Report recurring cases upstream with the ShareTinkerLog trace.
Defensive patterns

Strategy: try-catch

Try / catch

catch (TinkerRuntimeException e) {
    if (e.getMessage() != null && e.getMessage().contains("lib file not found, but path is null")) {
        Tinker.with(app).cleanPatch();
    } else throw e;
}

Prevention

When it happens

Trigger: Result code ERROR_LOAD_PATCH_VERSION_LIB_FILE_NOT_EXIST arrives without INTENT_PATCH_MISSING_LIB_PATH set. Occurs when an individual lib/*.so inside the versioned patch directory is deleted after installation or when loader and lib versions disagree on extras.

Common situations: Device cleaner / root tool removing .so files; patch containing only some ABIs while the device expects another; loader vs library version skew.

Related errors


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