AppLovin / AppLovin-MAX-SDK-Android

Other
233 stars 104 forks source link

SDK v12.4.0: Initialization is not completed. #648

Closed takazawa-gg closed 7 months ago

takazawa-gg commented 7 months ago

MAX SDK Version

12.4.0

Device/Platform Info

Android 13, Pixel 6a

Current Behavior

After updating to SDK v12.4.0, initializeSdk() became Deprecated, so I'm trying the new initialize(). However, initialization is not completed.

When I look at the log, the following error is output. Do I need to set TargetingData even if I don't use it?

java.lang.NullPointerException: Attempt to invoke virtual method 
'java.util.Map com.applovin.impl.sdk.AppLovinTargetingDataImpl.getJsonData()' on a null object reference

If there is any documentation that describes how to write a new initialization, please let me know.

Expected Behavior

No response

How to Reproduce

I am trying to initialize it with the following code.

public void initializeSDK(Boolean enableVerboseLogging) {
    Log.i(CLASS_NAME, "initializeSDK()");

    AppLovinSdkInitializationConfiguration initConfig = AppLovinSdkInitializationConfiguration.builder(SDK_KEY, getActivity())
            .setMediationProvider(AppLovinMediationProvider.MAX)
            .configureSettings(settings -> {
                AppLovinTermsAndPrivacyPolicyFlowSettings flowSettings = settings.getTermsAndPrivacyPolicyFlowSettings();

                if (enableVerboseLogging) {
                    settings.setVerboseLogging(true);
                }

                if (enableConsentFlow) {
                    flowSettings.setEnabled(true);
                }

                if (privacyUrl != null && !privacyUrl.isEmpty()) {
                    flowSettings.setPrivacyPolicyUri(Uri.parse(privacyUrl));
                }

                if (termsUrl != null && !termsUrl.isEmpty()) {
                    flowSettings.setTermsOfServiceUri(Uri.parse(termsUrl));
                }

                if (enableDebugUserGeographyGDPR) {
                    flowSettings.setDebugUserGeography(AppLovinSdkConfiguration.ConsentFlowUserGeography.GDPR);
                }
            })
            .build();

    AppLovinSdk.getInstance(getActivity()).initialize(initConfig, initListener -> {
        Log.i(CLASS_NAME, "initializeSDK() @ AppLovin SDK is initialized, start loading ads.");
        Log.i(CLASS_NAME, "initializeSDK() @ CountryCode: " + initListener.getCountryCode());
        Log.i(CLASS_NAME, "initializeSDK() @ ConsentFlowUserGeography: " + initListener.getConsentFlowUserGeography());

        isInitializedSDK = true;
        dispatchStatusEventAsync("didInitializeSdk", "");
    });
}

Additional Info

Android log file 20240403_max_init_failed.zip

Screenshot_20240403-162756

apshard commented 7 months ago

We see the same error.

NanaAmoah commented 7 months ago

Hi @takazawa-gg @apshard, we are aware of this issue and are currently working on a fix.

abinhho commented 7 months ago

Same here!

Error generating signals for RTB
java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.Map com.applovin.impl.sdk.AppLovinTargetingDataImpl.getJsonData()' on a null object reference
    at com.applovin.impl.sdk.n.a(SourceFile:253)
    at com.applovin.impl.sdk.n.Dy(SourceFile:240)
    at com.applovin.impl.sdk.n.getBidToken(SourceFile:187)
    at com.applovin.impl.sdk.AppLovinAdServiceImpl.getBidToken(SourceFile:150)
    at com.google.ads.mediation.applovin.AppLovinMediationAdapter.collectSignals(AppLovinMediationAdapter.java:287)
    at com.google.android.gms.internal.ads.zzbve.zzh(com.google.android.gms:play-services-ads-lite@@23.0.0:15)
    at com.google.android.gms.internal.ads.zzbur.zzbO(com.google.android.gms:play-services-ads-lite@@23.0.0:136)
    at com.google.android.gms.internal.ads.zzayh.onTransact(com.google.android.gms:play-services-ads-base@@23.0.0:3)
    at android.os.Binder.transact(Binder.java:1049)
    at m.ajm.bc(:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:8)
    at com.google.android.gms.ads.internal.mediation.client.rtb.p.h(:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:24)
    at com.google.android.gms.ads.nonagon.signals.en.f(:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:24)
    at com.google.android.gms.ads.nonagon.signals.ek.a(:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:187)
    at m.cdv.a(:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:3)
    at m.cdd.run(:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:21)
    at m.cdx.run(:com.google.android.gms.policy_ads_fdr_dynamite@240304709@240304704034.602821767.602821767:5)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:923)
guowei0306 commented 7 months ago

Hi all, we've fixed this init completion callback issue in the latest SDK v12.4.2, please upgrade to this version and see if it works. https://github.com/AppLovin/AppLovin-MAX-SDK-Android/releases

takazawa-gg commented 7 months ago

Hi, We were able to confirm that initialization was completed by updating to v12.4.2. Thank you for the update!