AppLovin / AppLovin-MAX-SDK-Android

Other
210 stars 95 forks source link

Attempt to invoke virtual method 'int android.graphics.drawable.Drawable.getIntrinsicWidth()' on a null object reference at com.applovin.impl.sdk.nativeAd.AppLovinMediaView.getAspectRatio #636

Closed jesphinpt closed 3 months ago

jesphinpt commented 3 months ago

MAX SDK Version

11.11.3@aar

Device/Platform Info

Android

Current Behavior

Crashing the app in the Samsung Models

[samsung a31 (Galaxy A31)] [Android 12 (SDK 31)]


Exception java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.drawable.Drawable.getIntrinsicWidth()' on a null object reference
  at com.applovin.impl.sdk.nativeAd.AppLovinMediaView.getAspectRatio
  at com.applovin.mediation.adapters.AppLovinMediationAdapter$3.onNativeAdLoaded
  at com.applovin.impl.sdk.nativeAd.e$1.run
  at android.os.Handler.handleCallback (Handler.java:938)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:226)
  at android.os.Looper.loop (Looper.java:313)
  at android.app.ActivityThread.main (ActivityThread.java:8663)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:571)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1135)

Expected Behavior

Fix the crashes in the device. I am facing the error with the app and it showing velocity alert now.

How to Reproduce

App which contains the different ads with Native(Manual), MREC and AppOpen ads with mediation adapters

Additional Info

No response

thomasmso commented 3 months ago

This was fixed in in v11.4.1 and higher. These crashes are probably from older SDKs trickling in.