Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash: Adding Terms & Privacy with minified build #659

Open
adurandet opened this issue Apr 23, 2024 · 2 comments
Open

Crash: Adding Terms & Privacy with minified build #659

adurandet opened this issue Apr 23, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@adurandet
Copy link

adurandet commented Apr 23, 2024

MAX SDK Version

12.4.2

Device/Platform Info

Is not device / plateform specific

Current Behavior

I am trying to add Terms and Privacy UMP flow. I followed your documentation.

I did a first attempt programmatically and try the json integration but both solution lead to a crash.

Programmaticly - Logs

D  [AppLovinSdkInitializationConfiguration] Initializing with key: 
D  [AppLovinSdkInitializationConfiguration] setMediationProvider(mediationProvider=max)
D  [ConsentFlowSettingsImpl] Setting consent flow enabled: true
D  [ConsentFlowSettingsImpl] Setting privacy policy: https://privacy
D  [ConsentFlowSettingsImpl] Setting terms of service: https://terms
D  [AppLovinSdk] 
   ========================================
   SDK Session Begin
   ========================================
E  FATAL EXCEPTION: main
   Process: com.xyz.ft.debug, PID: 20837
   java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equalsIgnoreCase(java.lang.String)' on a null object reference
   	at com.applovin.impl.r4.a(SourceFile:19)
   	at com.applovin.impl.r4.a(SourceFile:116)
   	at com.applovin.impl.r4.a(SourceFile:90)
   	at com.applovin.impl.r4.c(SourceFile:1)
   	at com.applovin.impl.U.run(Unknown Source:27)
   	at android.os.Handler.handleCallback(Handler.java:959)
   	at android.os.Handler.dispatchMessage(Handler.java:100)
   	at android.os.Looper.loopOnce(Looper.java:232)
   	at android.os.Looper.loop(Looper.java:317)
   	at android.app.ActivityThread.main(ActivityThread.java:8501)
   	at java.lang.reflect.Method.invoke(Native Method)
   	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
   	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

JSON - logs

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equalsIgnoreCase(java.lang.String)' on a null object reference
       at com.applovin.impl.r4.a(SourceFile:1601)
       at com.applovin.impl.r4.a(SourceFile:2963)
       at com.applovin.impl.r4.a(SourceFile:2259)
       at android.os.Handler.handleCallback(Handler.java:959)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loopOnce(Looper.java:232)
       at android.os.Looper.loop(Looper.java:317)
       at android.app.ActivityThread.main(ActivityThread.java:8501)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
[PersistentPostbackQueueSaveTask] Postbacks queue file does not exist.

The crash doesn't occur when the app is NOT minify. So it could be a R8/Progruard issue.

Expected Behavior

UMP flow should be dispay and app not crash.

How to Reproduce

Build an app to display UMP flow with minify enabled. Init AppLovin SDK -> App crash.

Additional Info

No response

@adurandet adurandet added the bug Something isn't working label Apr 23, 2024
@adurandet adurandet changed the title Crash: Adding Terms & Privacy with minizes build Crash: Adding Terms & Privacy with minized build Apr 23, 2024
@adurandet
Copy link
Author

adurandet commented Apr 23, 2024

By using the following code, though I can see termsFlowSettings is deprecated, I managed to see the popup you can see in screenshot but taping continue I am still facing a crash.

val initConfig = AppLovinSdkInitializationConfiguration.builder(AppLovinKey.appLovinKey, context)
            .setMediationProvider(AppLovinMediationProvider.MAX)
            .configureSettings { settings ->
                settings.termsAndPrivacyPolicyFlowSettings.apply {
                    isEnabled = true
                }
                settings.termsFlowSettings.apply {
                    privacyPolicyUri = Uri.parse(Urls.privacy)
                    termsOfServiceUri = Uri.parse(Urls.terms)
                }
            }
            .build()

        AppLovinSdk.getInstance(context)
            .initialize(initConfig) {
                _isInitialized.value = true
            }

popup

FATAL EXCEPTION: main
Process: com.xyz.ft.debug, PID: 4979
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equalsIgnoreCase(java.lang.String)' on a null object reference
    at com.applovin.impl.r4.a(SourceFile:19)
    at com.applovin.impl.r4.a(SourceFile:5)
    at com.applovin.impl.r4$c.onClick(Unknown Source:19)
    at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:175)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loopOnce(Looper.java:232)
    at android.os.Looper.loop(Looper.java:317)
    at android.app.ActivityThread.main(ActivityThread.java:8501)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

@adurandet adurandet changed the title Crash: Adding Terms & Privacy with minized build Crash: Adding Terms & Privacy with minified build Apr 23, 2024
@adurandet
Copy link
Author

Issue has been resolved by adding the following proguard rule
-keep class org.json.** { *; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant