Skip to content

PrefetchOperationCallbackAdapter.onSuccess NPE crash caused by lowered webkit dependency in 11.2.0 #4207

Description

@aceofc

[REQUIRED] Step 1: Describe your environment

  • Unity version: 6000.0.75f1
  • Google Mobile Ads Unity plugin version: 11.2.0 (regression)
  • Last known working version: 11.1.0
  • Plugin installation method: UPM
  • GMA Android SDK architecture: Next-Gen SDK (enabled)
  • Platform: Android
  • Scripting backend: IL2CPP, arm64-v8a
  • Affected OS / devices (production):
    • Android 13 - Samsung SM-A715F
    • Android 15 - Xiaomi 23073RPBFG
    • Android 16 - Xiaomi 24090RA29G
  • Mediation adapters: AppLovin 8.7.3, ironSource 4.5.1, Unity Ads 3.18.0, DT Exchange 3.5.8

[REQUIRED] Step 2: Describe the problem

Regression introduced in 11.2.0. The exact same app - same Next-Gen setting,
same mediation adapters, no changes to our ad code - ran fine on 11.1.0 and
started crashing in production immediately after upgrading to 11.2.0.

The crash is a fatal NPE inside androidx.webkit, in the WebView prefetch
callback path (PrefetchOperationCallbackAdapter$1.onSuccess), dispatched via
the chromium boundary-interface reflection proxy on a System WebView thread.
It happens on cold start, during the ad init/load window.

Suspected root cause: the 11.2.0 changelog adds
next_gen_resolution_strategy.gradle to "use lower webkit and
error_prone_annotation library to support older Unity Editors."
This lowers the
androidx.webkit version. The crash is precisely in androidx.webkit's
PrefetchOperationCallbackAdapter.onSuccess, an API that is recent and still
being stabilized upstream. The lowered webkit version pulled in by 11.2.0 appears
to trigger this NPE, which did not occur with the webkit version resolved by 11.1.0.

Deobfuscated stack trace

Exception java.lang.Error:
  at androidx.webkit.internal.PrefetchOperationCallbackAdapter$1.onSuccess (PrefetchOperationCallbackAdapter.java:46)
  at java.lang.reflect.Method.invoke
  at org.chromium.support_lib_boundary.util.BoundaryInterfaceReflectionUtil$InvocationHandlerWithDelegateGetter.invoke (BoundaryInterfaceReflectionUtil.java:203)
  at java.lang.reflect.Proxy.invoke (Proxy.java:1006)
  at $Proxy28.onSuccess (Unknown Source)
  at WV.r22.run (chromium-SystemWebViewGoogle6432.aab-stable-777817803:37)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:919)

Steps to reproduce

  1. Plugin 11.2.0, Next-Gen GMA Android SDK enabled, mediation configured.
  2. Cold start the app; ad initialization / loading begins.
  3. Crash on a WebView thread in PrefetchOperationCallbackAdapter.onSuccess.
    Production-only, not deterministically reproducible.

What we'd like

  • Restore the androidx.webkit version used by 11.1.0, or
  • Make next_gen_resolution_strategy.gradle opt-in / not force a lower webkit for
    projects that don't need older-Editor support, since the lowered version
    introduces this crash.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions