Diagnostic plugins crashes on Android Lollipop (API 21)


#1

Diagnostic plugins work just fine in API 22 and greater but crash on API 21. No issue when building but when crashes when opened.

Here is my plugin list

cordova-android-play-services-gradle-release 1.2.1 “cordova-android-play-services-gradle-release”
cordova-android-support-gradle-release 1.2.1 “cordova-android-support-gradle-release”
cordova-plugin-camera 4.0.2 “Camera”
cordova-plugin-device 2.0.1 “Device”
cordova-plugin-geolocation 4.0.1 “Geolocation”
cordova-plugin-ionic-keyboard 2.0.5 “cordova-plugin-ionic-keyboard”
cordova-plugin-ionic-webview 1.1.16 “cordova-plugin-ionic-webview”
cordova-plugin-nativestorage 2.3.1 “NativeStorage”
cordova-plugin-network-information 2.0.1 “Network Information”
cordova-plugin-request-location-accuracy 2.2.2 “Request Location Accuracy”
cordova-plugin-splashscreen 5.0.2 “Splashscreen”
cordova-plugin-whitelist 1.3.3 “Whitelist”
cordova-sqlite-storage 2.3.0 “Cordova sqlite storage plugin”
cordova.plugins.diagnostic 4.0.3 “Diagnostic”


#2

What is your ionic info output?
Did you check the Github issues of the plugin you are using?


#3

Here is my ionic info

cli packages: (C:\Users\Cedrick\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : android 7.0.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v6.11.0
npm               : 3.10.10
OS                : Windows 10

Environment Variables:

ANDROID_HOME : C:\Users\Cedrick\AppData\Local\Android\sdk

Misc:

backend : pro

I already checked the documentation and it says there that
“Calling on Android 5 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.” so I assume that API 22 and below are supported.


#4

Your Cordova tooling seems to be out of date, which might be causing all kinds of problems.
You can read about how to figure out the current Cordova versions and how to update CLI, platforms and plugins here: https://ionic.zone/cordova/update


#5

Hi, I already updated my cordova but the problem still exists. Again there are no errors when building, but the it crashes when I open the app.

Steps to reproduce :

  1. Open emulator with API 22 and below
  2. Install plugin DIAGNOSTICS
    $ ionic cordova plugin add cordova.plugins.diagnostic
    $ npm install --save @ionic-native/diagnostic
  3. Run “ionic cordova emulate android”