Skip to content

Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. #1007

@AifeiI

Description

@AifeiI

AndroidObjectBrowser not working in Android 12

objectBox version: 2.9.1

app/build.gradle ->

android {
    compileSdkVersion 31
    buildToolsVersion "31.0.0"

    defaultConfig {
        applicationId "com.demo"
        minSdkVersion 23
        targetSdkVersion 31
        ... ...
    }

    ... ...
}
Caused by: java.lang.IllegalArgumentException: com.demo: 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:375)
        at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
        at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
        at io.objectbox.android.AndroidObjectBrowser.start(AndroidObjectBrowser.java:98)
        at com.demo.DemoApplication.initDB(DemoApplication.kt:116)
        at com.demo.DemoApplication.onCreate(DemoApplication.kt:64)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1211)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6708)
        	... 9 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions