2

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, e.g. 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

RGS
  • 4,062
  • 4
  • 31
  • 67
  • 2
    Simply file an [issue](https://github.com/libpd/pd-for-android/issues) and provide PR to it, then update the dependency. – Martin Zeitler May 15 '22 at 19:24
  • @MartinZeitler there is nothing I can do? Need to wait them? – RGS May 15 '22 at 19:25
  • You can also link against the library project and fix it locally, but this doesn't fix the provided AAR library... but when already doing so, you can as well push these changes as PR. – Martin Zeitler May 15 '22 at 19:26
  • @MartinZeitler Can you give me an example of that? They usually take much time to correct things and I cannot wait. – RGS May 15 '22 at 19:29
  • 1
    I'm not going to explain how forking and pull requests work, as this is well documented, but can tell which line to fix: https://github.com/libpd/pd-for-android/blob/master/PdCore/src/main/java/org/puredata/android/service/PdService.java#L245 – Martin Zeitler May 15 '22 at 19:32
  • were you able to fix this,without updating library – uncle_scrooge Mar 06 '23 at 05:49

1 Answers1

-3

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

android:exported="true"
flyingfishcattle
  • 1,817
  • 3
  • 14
  • 25
Arsalan
  • 1
  • 1