I have a mobile app in which different plugins are installed, including the Background Mode Plugin. My mobile app is crashing and also camera plugin related functionality not working fine. When I disabled Background Mode Plugin, then my application is working fine. When I enable the Background Mode Plugin then I'm getting this error:
Try updating or replacing the plugin, like using @capacitor/background-task if you're on Capacitor. Also, check for permission or lifecycle conflicts.
Hi @Abdul Rehman,
Please follow this steps it will work for you.
Option 1: Replace the Plugin with a Supported One
If you're using something like BackgroundMode from Forge:
Go to Forge, check the plugin (BackgroundMode, Advanced Background Mode, etc.).
Check the plugin's documentation and see if it's been updated for Android 12+.
If not, look for an alternative Forge component or create your own plugin using:
@capacitor/background-task for Capacitor-based apps.
Or an updated Cordova plugin with Android 12+ support.
Option 2: Patch the Cordova Plugin (If Custom or Unmaintained)
If you're using a custom Cordova plugin or an old Forge plugin, you can manually update the Java code like this:
Go to Service Center → Factory → Mobile Plugins.
Locate the plugin causing the issue.
Click Download to get the source code (ZIP).
Extract and go to the plugin's src/android folder.
Open any file creating a PendingIntent (likely BackgroundService.java).
Modify the code to set the flag:
javaCopyEdit// OldPendingIntent intent = PendingIntent.getService(context, 0, someIntent, 0);// New (fixed)PendingIntent intent = PendingIntent.getService(context, 0, someIntent, PendingIntent.FLAG_IMMUTABLE);
Repackage the plugin as ZIP and re-upload it to OutSystems via Service Center.
Rebuild and redeploy your mobile app.
Option 3: Override targetSdkVersion (Temporary Hack – Not Recommended)
Go to Service Center → Your App → Native Platforms.
Add this to the Extensibility Configuration:
jsonCopyEdit{ "android": { "compileSdkVersion": 31, "targetSdkVersion": 30 }}