How to detect which external libraries/dependencies use PendingIntent?

Viewed 108

I am getting the following error in Android 12:

Fatal Exception: java.lang.IllegalArgumentException
 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.

I changed all of my flags to FlagImmutable, but still that error was being shown. Then I commented out all the PendingIntents inside my project and still that error was there, which made me think that external libs might be using those PendingIntents. Is there a way to detect which exact dependencies are using PendingIntents?

1 Answers

The error showed up when I updated the app to Android version 13 (API 33) having some dependencies far below the latest stable.

I haven't found any way to know which dependency uses the PendingIntent but in the end, I managed to solve it using common sense.

In my case the library that produced the error was androidx.work:work-runtime but the other candidates I had in my list were firebase, play-services, etc.

Related