I created Android freshly with cap add android. App is working on Android 11 without problems
When I try to run my app on Android 12, I get this error in Android Studio run console
.E/AndroidRuntime: FATAL EXCEPTION: pool-12-thread-1
Process: com.restegourmet.rg_eat, PID: 32757
java.lang.IllegalArgumentException: com.mydomain.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:382)
at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:673)
at android.app.PendingIntent.getBroadcast(PendingIntent.java:660)
at androidx.work.impl.utils.ForceStopRunnable.getPendingIntent(ForceStopRunnable.java:174)
at androidx.work.impl.utils.ForceStopRunnable.isForceStopped(ForceStopRunnable.java:108)
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:86)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:75)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at java.lang.Thread.run(Thread.java:1012)
There is some plugin that needs to be updated, would be helpful if you provide your plugin list. npx cap ls should list all your capacitor plugins, or you can check the package.json
You can force it like this for all modules, but not sure if admob plugin could break if the newer version is not compatible or introduced breaking changes
configurations.all {
resolutionStrategy {
force 'androidx.work:work-runtime:2.7.1'
}
}