简体   繁体   中英

How to correct missing pending intent on android 12 in a third party library?

I have a 3rd party library that uses pending intent and my app crushes on android 12 because of that:

java.lang.IllegalArgumentException: com.myapp: 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, eg if it needs to be used with inline replies or bubbles. at android.app.PendingIntent.checkFlags(PendingIntent.java:375)

I try to add:

implementation 'androidx.work:work-runtime:2.7.1'

but the error continues.

I also tried to add:

allproject {
  project.configurations.all {
    resolutionStrategy {
      force 'androidx.work:work-runtime:2.7.0'
    }
  }
}

in my build.gradle and nothing.

The library I need to use is this one:

implementation 'org.puredata.android:pd-core:1.2.1-rc1'

<service android:name="org.puredata.android.service.PdService"
            android:foregroundServiceType="microphone|phoneCall" />

Any ideas how to make it work? Thanks

Add exported tag in your service or activity in manifest. For example

android:exported="true"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM