Closed ashakirov closed 2 months ago
Hey @ashakirov, thanks for flagging this. We have a fix in our upcoming SDK release for this issue. We'll notify you in this thread when it's released.
@ashakirov our latest SDK release has a fix for this issue.
MAX SDK Version
12.6.1
Device/Platform Info
Android 14
Current Behavior
There is bug in
AppLovinMediaView
class. It callsremoveAllViews
method from wrong thread (fromAppLovinSdk:shared_thread_pool
). But call have to be done frommain
thread because this call is trying to change view hierarchy.Here is full stacktrace:
[MediationAdapterWrapper] Failed operation destroy for APPLOVIN_NETWORK android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. Expected: main Calling: AppLovinSdk:shared_thread_pool at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:9994) at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:2082) at android.view.View.requestLayout(View.java:27043) at android.view.View.requestLayout(View.java:27043) at android.view.View.requestLayout(View.java:27043) at android.view.View.requestLayout(View.java:27043) at android.view.View.requestLayout(View.java:27043) at android.view.View.requestLayout(View.java:27043) at android.view.View.requestLayout(View.java:27043) at android.view.View.requestLayout(View.java:27043) at android.view.View.requestLayout(View.java:27043) at androidx.constraintlayout.widget.ConstraintLayout.requestLayout(ConstraintLayout.java:3146) at android.view.View.requestLayout(View.java:27043) at android.view.View.requestLayout(View.java:27043) at android.view.View.requestLayout(View.java:27043) at androidx.constraintlayout.widget.ConstraintLayout.requestLayout(ConstraintLayout.java:3146) at android.view.View.requestLayout(View.java:27043) at android.widget.HorizontalScrollView.requestLayout(HorizontalScrollView.java:1691) at android.view.View.requestLayout(View.java:27043) at android.view.View.requestLayout(View.java:27043) at android.view.ViewGroup.removeAllViews(ViewGroup.java:5759) at com.applovin.impl.sdk.nativeAd.AppLovinMediaView.destroy(SourceFile:4) at com.applovin.impl.sdk.nativeAd.AppLovinNativeAdImpl.unregisterViewsForInteraction(SourceFile:31) at com.applovin.impl.sdk.nativeAd.AppLovinNativeAdImpl.destroy(SourceFile:1) at com.applovin.mediation.adapters.AppLovinMediationAdapter.onDestroy(SourceFile:15) at com.applovin.impl.mediation.g.l(SourceFile:3) at com.applovin.impl.mediation.g.$r8$lambda$M0-41Qz0EJAwuzvMp176QgZnzQA(Unknown Source:0) at com.applovin.impl.mediation.g$$ExternalSyntheticLambda11.run(D8$$SyntheticClass:0) at com.applovin.impl.mediation.g.a(SourceFile:5870) at com.applovin.impl.mediation.g.$r8$lambda$Bzit5t9eqfA6lP9x96YlsSo49TU(Unknown Source:0) at com.applovin.impl.mediation.g$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0) at com.applovin.impl.jn.run(SourceFile:46) at com.applovin.impl.tm$d.run(SourceFile:24) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487) at java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at java.lang.Thread.run(Thread.java:1012)
Here is screenshot from debugger:
Expected Behavior
No response
How to Reproduce
MaxNativeAdLoader.loadAd
methodMaxNativeAdLoader.destroy
(call it frommain
thread).Additional Info
No response