Tencent/tinker · error · TinkerRuntimeException

listener must not be null.

Error message

listener must not be null.

What it means

Error "listener must not be null." thrown in Tencent/tinker.

Source

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

            }
            this.loadReporter = loadReporter;
            return this;
        }

        public Builder patchReporter(PatchReporter patchReporter) {
            if (patchReporter == null) {
                throw new TinkerRuntimeException("patchReporter must not be null.");
            }
            if (this.patchReporter != null) {
                throw new TinkerRuntimeException("patchReporter is already set.");
            }
            this.patchReporter = patchReporter;
            return this;
        }

        public Builder listener(PatchListener listener) {
            if (listener == null) {
                throw new TinkerRuntimeException("listener must not be null.");
            }
            if (this.listener != null) {
                throw new TinkerRuntimeException("listener is already set.");
            }
            this.listener = listener;
            return this;
        }

        public Tinker build() {
            if (status == -1) {
                status = ShareConstants.TINKER_ENABLE_ALL;
            }

            if (loadReporter == null) {
                loadReporter = new DefaultLoadReporter(context);
            }

            if (patchReporter == null) {

View on GitHub (pinned to 1b7ea02c23)

Solutions

  1. Pass a non-null PatchListener implementation to Builder.listener().
  2. Guard the call: only call Builder.listener(listener) after verifying listener != null.

When it happens

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

Common situations: Thrown from Tinker.Builder.listener() when the supplied PatchListener is null. Usually caused by a listener field that was never initialized before Tinker installation.


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