AppLovin / AppLovin-MAX-SDK-Android

Other
210 stars 95 forks source link

GoogleMediationAdapter throws an exception. #525

Open Apptrick-Cheetah opened 11 months ago

Apptrick-Cheetah commented 11 months ago

MAX SDK Version

11.10.1

Device/Platform Info

Mostly Samsung android 12

Current Behavior

Getting exception on below line of code in GoogleMediationAdapter in initialize method

MobileAds.disableMediationAdapterInitialization( context );

Not occuring in all devices but mostly SAMSUNG Devices android 12, some android 11 devices too.

here is the complete log

Fatal Exception: java.lang.VerifyError
Verifier rejected class y8.em1: void y8.em1.run() failed to verify: void y8.em1.run(): [0x195] register v0 has type Reference: org.json.JSONException but expected Reference: java.lang.RuntimeException (declaration of 'y8.em1' appears in base.apk!classes2.dex)

com.applovin.mediation.adapters.GoogleMediationAdapter.initialize (GoogleMediationAdapter.java:136)
com.applovin.impl.mediation.g$1.run (SourceFile:143)
com.applovin.impl.mediation.g$11.run (SourceFile:827)
com.applovin.impl.mediation.g.a (SourceFile:850)
com.applovin.impl.mediation.g.a (SourceFile:807)
com.applovin.impl.mediation.g.a (SourceFile:130)
com.applovin.impl.mediation.e.a (SourceFile:147)
com.applovin.impl.mediation.e.a (SourceFile:105)
com.applovin.impl.mediation.MediationServiceImpl.collectSignal (SourceFile:331)
com.applovin.impl.mediation.c.b.a (SourceFile:225)
com.applovin.impl.mediation.c.b.b (SourceFile:200)
com.applovin.impl.mediation.c.b.run (SourceFile:118)
java.util.concurrent.Executors$RunnableAdapter.call (Executor.java:463)
java.util.concurrent.FutureTask.run (FutureTask.java:264)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run (ScheduledThreadPool;Executor.java:307)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1137)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:637)
java.lang.Thread.run (Thread.java:1012)

Expected Behavior

Should not crash and works fine.

How to Reproduce

it crashes on the splash when app is opened.

Additional Info

Firebase version I'm using

implementation platform('com.google.firebase:firebase-bom:32.1.1')

implementation 'com.google.firebase:firebase-crashlytics-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-config-ktx'
implementation 'com.google.firebase:firebase-messaging-ktx'
implementation 'com.google.firebase:firebase-database-ktx'
implementation 'com.google.firebase:firebase-storage-ktx'

Adapter version I'm using

implementation 'com.applovin:applovin-sdk:11.10.1'
implementation 'com.applovin.mediation:google-adapter:22.1.0.3'
thomasmso commented 11 months ago

If the issue occurs with AdMob only, then the issue is usually on them.

Thus, I'm not sure what actions we can take on our end, besides not calling their SDK's disableMediationAdapterInitialization() call.

You can try to just disable jacoco for the adapter:

android {
    // ...

    jacoco {
        excludes = ['com/applovin/mediation/adapters/GoogleMediationAdapter/**']
    }
}
Apptrick-Cheetah commented 11 months ago

If I disable jacoco for the adapter, will my app be able to show admob Ads through Max?