After upgrading AdMob from 23.3.0 to 23.4.0 I get the following errors during Release build:
Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in [My project folder]/build/outputs/mapping/release/missing_rules.txt.
And
Missing class android.media.LoudnessCodecController$OnLoudnessCodecUpdateListener (referenced from: void com.google.android.gms.internal.ads.zzsp.zzd(int) and 1 other context)
Missing class android.media.LoudnessCodecController (referenced from: android.media.LoudnessCodecController com.google.android.gms.internal.ads.zzsp.zzb and 4 other contexts)
The following issue was reported to Google: https://groups.google.com/g/google-admob-ads-sdk/c/NXPiDjbT2QE/m/PKKmI-38AwAJ
Any workaround except downgrading to AdMob 23.3.0?
How to reproduce the issue in a new, clean project:
android
=> buildTypes
=> release
, set isMinifyEnabled = true
.dependencies
, add api("com.google.firebase:firebase-ads:23.4.0")
Build Variants
to Release
.Build
=> Build App Bundle(s)/APK(s)
=> Build Bundle(s)
.The build will fail with the same error.
Update: Upgrading to AdMob 23.5.0 cause the same issue.
AdMob 23.4.0 uses android.media.LoudnessCodecController
which was added to Android only in SDK 35.
The documentation of AdMob 23.1.0 clearly states: Requires a minimum compileSdkVersion of 34
, however version 23.4.0 is missing the following: Requires a minimum compileSdkVersion of 35
.
There are 3 solutions: