question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App crashing Cordova-android 11

See original GitHub issue

Bug Report

Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.

Problem

Application crash on startup

What is expected to happen?

Application should work after change Cordova-android-11 with target sdk 32

What does actually happen?

Application crash on startup

App not compile

Screenshot 2022-07-28 at 6 39 14 PM

Screenshot 2022-07-28 at 6 48 03 PM

Fixed using

After add implementation 'androidx.work:work-runtime:2.7.0-alpha05' to cordovaLib-> build.gradle file application works

Version information

Ionic:

   Ionic CLI          : 6.20.1 (/Users/bhuminbhandari/.nvm/versions/node/v14.15.4/lib/node_modules/@ionic/cli)
   Ionic Framework    : ionic-angular 3.9.10
   @ionic/app-scripts : 3.2.3

Cordova:

   Cordova CLI       : 11.0.0
   Cordova Platforms : android 11.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 22 other plugins)

Utility:

   cordova-res (update available: 0.15.4) : 0.15.0
   native-run                             : 1.6.0

System:

   Android SDK Tools : 26.1.1 (/Users/bhuminbhandari/Library/Android/sdk)
   ios-sim           : 8.0.2
   NodeJS            : v14.15.4 (/Users/bhuminbhandari/.nvm/versions/node/v14.15.4/bin/node)
   npm               : 6.14.10
   OS                : macOS Monterey
   Xcode             : Xcode 13.4.1 Build version 13F100

CDV-gradle

"MIN_SDK_VERSION": 25,
"SDK_VERSION": 32,
"COMPILE_SDK_VERSION": 32,
"GRADLE_VERSION": "7.4.2",
"MIN_BUILD_TOOLS_VERSION": "32.0.0",
"AGP_VERSION": "7.2.1",
"KOTLIN_VERSION": "1.5.21",
"ANDROIDX_APP_COMPAT_VERSION": "1.4.2",
"ANDROIDX_WEBKIT_VERSION": "1.4.0",
"ANDROIDX_CORE_SPLASHSCREEN_VERSION": "1.0.0-rc01",
"GRADLE_PLUGIN_GOOGLE_SERVICES_VERSION": "4.3.8",
"IS_GRADLE_PLUGIN_GOOGLE_SERVICES_ENABLED": true,
"IS_GRADLE_PLUGIN_KOTLIN_ENABLED": false

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
breautekcommented, Aug 2, 2022

Thank you @breautek you are right this is due to some plugin dependancy. But this is a bit weird issue, all the plugins I used in the project I installed in the blank project of cordova and everything works, don’t know what is the problem and where is the problem?

If building on a blank cordova project works, then I’ll try to let Cordova build the native project from scratch. Easiest way to do this is by removing the platform and re-adding it again, as noted in my above comment. Also if you were upgrading plugins, it might be best to remove them then re-add them as well, that way the native project gets configured from a clean slate.

0reactions
jcesarmobilecommented, Aug 31, 2022

This is something plugins need to fix because is an SDK 32 requirement. I see @havesource/cordova-plugin-push have already fixed it, but hasn’t released the fix to npm yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android 11 : App crashed while opening a Camera inside the ...
My app is based on sencha touch and cordova. it's a hybrid app where We use camera to take a picture and attached...
Read more >
Cordova app crashes after I touch the screen with targetSdk 30
I am using cordova-android@10.0.0 to build the app. Though the app gets built successfully and also gets installed on the device.
Read more >
App Center Crashes for Apache Cordova - Microsoft Learn
App Center Crashes will automatically generate a crash log every time your app crashes. The log is first written to the device's storage...
Read more >
Camera Plugin Released! - Apache Cordova
The 5.0.2 patch release fixes a bug on Android. After taking a picture with the camera plugin on Android, the app could occasionally...
Read more >
App crashes on start - Ionic Forum
My app (Ionic 5 + Cordova 9.1.0) crashes when I try to start it on an Android 11 phone. When I look into...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found