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 for android version S: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. #159

Closed
superdiazzz opened this issue Dec 1, 2021 · 1 comment

Comments

@superdiazzz
Copy link

I got this issue after upgrate targetSdkVersion to 31, i use this dapendency

implementation ('com.facebook.android:audience-network-sdk:5.5.0'){
        exclude group: 'com.google.android.gms'
    }

and i initialized my apps with this snippet code in Application class

private fun defaultProcessInitialization(app: NewsApplication?) {
        if (BuildConfig.DEBUG) {
            StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder()
                    .detectAll()
                    .penaltyLog()
                    .build())
            StrictMode.setVmPolicy(StrictMode.VmPolicy.Builder()
                    .detectAll()
                    .penaltyLog()
                    .build())
        }
        // Let Audience Network SDK know that you want to use Multiprocess Support
        AdSettings.setMultiprocessSupportMode(
                AdSettings.MultiprocessSupportMode.MULTIPROCESS_SUPPORT_MODE_ON)

        if(BuildConfig.DEBUG){
            AdSettings.addTestDevice("xxxxx")
        }

        AudienceNetworkAds
                .buildInitSettings(app)
                .withInitListener(app)
                .initialize()
    }
Fatal Exception: java.lang.IllegalArgumentException: mobile.android.tribun: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
       at android.app.PendingIntent.checkFlags(PendingIntent.java:382)
       at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:465)
       at android.app.PendingIntent.getActivity(PendingIntent.java:451)
       at android.app.PendingIntent.getActivity(PendingIntent.java:415)
       at com.facebook.ads.redexgen.X.FF.E(FF.java:25701)
       at com.facebook.ads.redexgen.X.Fn.C(Fn.java:26419)
       at com.facebook.ads.redexgen.X.Fl.FC(Fl.java:26298)
       at com.facebook.ads.redexgen.X.Fl.PC(Fl.java:26369)
       at com.facebook.ads.redexgen.X.8E.C(8E.java:18158)
       at com.facebook.ads.redexgen.X.8E.getBidderToken(8E.java:18169)
       at com.facebook.ads.redexgen.X.FP.run(FP.java:25949)
       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:920)

Somebody, Please help me

@github-actions
Copy link

github-actions bot commented Dec 1, 2021

Dear developers. You will not be able to create new bug reports on GitHub after 28 April, and existing tickets will be automatically closed.

Instead, please use the bug report (https://developers.facebook.com/support/bugs/) tool to report a bug on Audience Network. Our engineers will get back to you as soon as possible.

If you have any other questions or suggestions relating to Facebook Audience Network, please use the online publisher support portal (https://www.facebook.com/business/publishersupport?hc_location=ufi) to submit a request.

@github-actions github-actions bot closed this as completed Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant