22
Views
2
Comments
[BackgroundMode Plugin] App is crashing, when I use the Background Mode Plugin
backgroundmode-plugin
Mobile icon
Forge asset by Alexandre Costa
Application Type
Mobile
Service Studio Version
11.54.60 (Build 63294)
Platform Version
11.28.0 (Build 43201)

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:

2025-09-25 14-38-22
Lokesh Kumar Yadav

Try updating or replacing the plugin, like using @capacitor/background-task if you're on Capacitor. Also, check for permission or lifecycle conflicts. 

UserImage.jpg
Amit Jat

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:

  1. Go to Forge, check the plugin (BackgroundMode, Advanced Background Mode, etc.).

  2. Check the plugin's documentation and see if it's been updated for Android 12+.

  3. 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:

  1. Go to Service Center → Factory → Mobile Plugins.

  2. Locate the plugin causing the issue.

  3. Click Download to get the source code (ZIP).

  4. Extract and go to the plugin's src/android folder.

  5. Open any file creating a PendingIntent (likely BackgroundService.java).

  6. 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);

  7. Repackage the plugin as ZIP and re-upload it to OutSystems via Service Center.

  8. Rebuild and redeploy your mobile app.

Option 3: Override targetSdkVersion (Temporary Hack – Not Recommended)

  1. Go to Service Center → Your App → Native Platforms.

  2. Add this to the Extensibility Configuration:

jsonCopyEdit{  "android": {    "compileSdkVersion": 31,    "targetSdkVersion": 30  }}



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.