AppLovin / AppLovin-MAX-SDK-Android

Other
227 stars 102 forks source link

MAX Mediation MediationAdapterBase.destroy() is getting invoke in background thread. #728

Open pm-vishal-chougule opened 5 days ago

pm-vishal-chougule commented 5 days ago

MAX SDK Version

12.6.1, 13.0.0

Device/Platform Info

Android

Crashes/ANRs per Day

10

Percentage of Users Affected

NA

First Occurrence of Crash/ANR

10 Oct 2024 Though the stacktrace is NPE and does not show any path of the AppLovinMAX Adapter, but the AppLovinMAX invokes destroy() callback in background and invalidates the internal resources of OpenWrap SDK and that's causing NPE.

Exception and Stack Trace

Caused by java.lang.NullPointerException: Attempt to invoke interface method 'void com.pubmatic.sdk.common.viewability.POBHTMLMeasurementProvider.signalAdEvent(com.pubmatic.sdk.common.viewability.POBHTMLMeasurementProvider$POBHTMLAdEventType)' on a null object reference at com.pubmatic.sdk.webrendering.mraid.POBMraidRenderer.h(POBMraidRenderer.java:4) at com.pubmatic.sdk.webrendering.mraid.POBMraidRenderer.onViewRendered(POBMraidRenderer.java:15) at com.pubmatic.sdk.webrendering.ui.POBHTMLRenderer.onPageFinished(POBHTMLRenderer.java:3) at com.pubmatic.sdk.webrendering.ui.POBHTMLViewClient.onPageFinished(POBHTMLViewClient.java:4) at m65.b(chromium-Monochrome.aab-stable-604519420:12) at Ay.handleMessage(chromium-Monochrome.aab-stable-604519420:277) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6823) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1557) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)

How to Reproduce

Steps:

  1. Create MaxAdView with placement details
  2. Load MaxAdView by calling loadAd(); API
  3. Destroy MaxAdView by calling destroy() API. with the above steps, you see MediationAdapterBase.destroy() invokes on the background thread.

Reproducible in the demo app?

No

Additional Info

Adapter implementation for View classes expects to be invoked on the Main thread. I can see a similar issue reported, reference: https://github.com/AppLovin/AppLovin-MAX-SDK-Android/issues/723

NanaAmoah commented 3 days ago

Hi @pm-vishal-chougule, we're looking into this and will keep you updated