Android NPE Crash on MobileAds.initialize() with SDK 24.4.0 on specific devices

23 views
Skip to first unread message

wudy Zou

unread,
Oct 27, 2025, 3:16:02 AM (5 days ago)  Oct 27
to Google Mobile Ads SDK Developers
crash log:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'void com.google.android.gms.ads.internal.client.zzck.zzo(com.google.android.gms.internal.ads.zzbpo)' on a null object reference at com.google.android.gms.ads.internal.client.zzl.zza(com.google.android.gms:play-services-ads-api@@24.4.0:6) at com.google.android.gms.ads.internal.client.zzas.zzc(com.google.android.gms:play-services-ads-api@@24.4.0:12) at com.google.android.gms.ads.internal.client.zzba.zzf(com.google.android.gms:play-services-ads-api@@24.4.0:1) at com.google.android.gms.ads.internal.client.zzba.zzd(com.google.android.gms:play-services-ads-api@@24.4.0:11) at com.google.android.gms.ads.internal.client.zzaz.zzg(com.google.android.gms:play-services-ads-api@@24.4.0:2) at com.google.android.gms.ads.zzb.zza(com.google.android.gms:play-services-ads-api@@24.4.0:1) at com.google.android.gms.ads.preload.zzb.<init>(com.google.android.gms:play-services-ads-api@@24.4.0:1) at com.google.android.gms.ads.internal.client.zzep.<init>(com.google.android.gms:play-services-ads-api@@24.4.0:1) at com.google.android.gms.ads.internal.client.zzey.zzq(com.google.android.gms:play-services-ads-api@@24.4.0:27) at com.google.android.gms.ads.MobileAds.initialize(com.google.android.gms:play-services-ads-api@@24.4.0:3) at com.sweet.music.tools.AdManager$init$1.invokeSuspend(AdManager.kt:30) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.java:115) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

Below is the relevant source code( Pay attention to the comments in red text ):
package com.google.android.gms.ads.internal.client;

import android.content.Context;
import android.os.RemoteException;
import com.google.android.gms.ads.internal.util.client.zzo;
import com.google.android.gms.dynamic.IObjectWrapper;
import com.google.android.gms.dynamic.ObjectWrapper;
import com.google.android.gms.dynamic.RemoteCreator;
import com.google.android.gms.internal.ads.zzbpo;
import javax.annotation.Nullable;

public final class zzl extends RemoteCreator {
    @Nullable
    public final zzck zza(Context var1, zzbpo var2) {
        RemoteException var10000;
        label38: {
            try {
                IObjectWrapper var3 = ObjectWrapper.wrap(var1);
                zzcl var9 = (zzcl)this.getRemoteCreatorInstance(var1);
                var10 = var9.zze(var3, var2, 252130000);
            } catch (RemoteCreator.RemoteCreatorException | RemoteException var8) {
                var10000 = var8;
                boolean var10001 = false;
                break label38;
            }

            Object var11;
            if (var10 == null) {
                var11 = null;
// if var10 is null,  var11 is null,
            } else {
                boolean var14;
                try {
                    var13 = var10.queryLocalInterface("com.google.android.gms.ads.internal.client.IAdPreloader");
                    var14 = var13 instanceof zzck;
                } catch (RemoteCreator.RemoteCreatorException | RemoteException var7) {
                    var10000 = var7;
                    boolean var15 = false;
                    break label38;
                }

                if (var14) {
                    try {
                        var11 = (zzck)var13;
                    } catch (RemoteCreator.RemoteCreatorException | RemoteException var6) {
                        var10000 = var6;
                        boolean var16 = false;
                        break label38;
                    }
                } else {
                    try {
                        var11 = new zzci(var10);
                    } catch (RemoteCreator.RemoteCreatorException | RemoteException var5) {
                        var10000 = var5;
                        boolean var17 = false;
                        break label38;
                    }
                }
            }
// var11 may be null, why not make a short judgment here?
            try {
                ((zzck)var11).zzo(var2);
                return (zzck)var11;
            } catch (RemoteCreator.RemoteCreatorException | RemoteException var4) {
                var10000 = var4;
                boolean var18 = false;
            }
        }

        RemoteException var12 = var10000;
        zzo.zzk("Could not get remote AdPreloaderCreator.", var12);
        return null;
    }

    public zzl() {
        super("com.google.android.gms.ads.AdPreloaderRemoteCreatorImpl");
    }
}

Mobile Ads SDK Forum Advisor

unread,
Oct 27, 2025, 9:20:28 AM (4 days ago)  Oct 27
to zou...@gmail.com, google-adm...@googlegroups.com

Hi ,

Thank you for contacting the Mobile Ads SDK Support team.

It is always recommended to use the latest versions of the SDK to avoid conflicts, please ensure you have integrated the latest one. As of today, the latest version of the Google Mobile Ads Android is  24.7.0 .

I have executed our Sample project and unfortunately we are unable to replicate the crash from our end. Could you please verify if the same behavior occurs in our sample project ? If so,please share the following details to help us investigate further:

  • Sample project reproducing the issue

  • Steps to replicate the issue

  • Affected devices information

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=500Ht00001vRpWkIAK&entry.80707362=00336601

2. Fill out all fields, and attach your file(s).

3. Please reply back to this thread when you have uploaded your file(s). Please do not share this link.

Thanks,
Google Logo
Mobile Ads SDK Team

Feedback
How was our support today?

rating1 rating2 rating3 rating4 rating5
[2025-10-27 13:19:26Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01vRpWk:ref" (ADR-00336601)



Reply all
Reply to author
Forward
0 new messages