简体   繁体   中英

Ionic 2 push notification not working in android version 4

I'm having a project with push notification(IONIC NATIVE PLUGIN). When running ionic cordova run android it works fine on android version 5. When the same running on android version 4 I'm getting the error

UNFORTUNATELY,'App NAME' has stopped.

I don't know what to do. Any help?

I found the solution.

Use cordova version : 7.1.0

Use cordova plaform version : 6.3.0

To boost the performance in the app use crosswalk

The device version includes from android 4 to present

@Melchia Your answer is valuable.

You need to consider downgrading your cordova version. Before creating an application you need to study you users (which version of Android they're using? Is it really worthy to make Android 4 version?...) You can't just install the latest version of cordova & hope everything is OK.

cordova-android Version     Supported Android API-Levels    Equivalent Android Version
6.X.X                                   16 - 25                   4.1 - 7.1.1
5.X.X                                   14 - 23                   4.0 - 6.0.1
4.1.X                                   14 - 22                   4.0 - 5.1
4.0.X                                   10 - 22                   2.3.3 - 5.1
3.7.X                                   10 - 21                   2.3.3 - 5.0.2

If you want to target Android 4.0 so install cordova 5.xx Run the following command $ npm i -g cordova@5.4.1 Then run the following command $ cordova platform add android@4.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM