没有虚拟方法getActiveNotifications()

时间:2017-12-18 10:28:49

标签: android cordova firebase ionic3 angular5

将应用程序升级到以下功能后,我开始出现以下错误。 (代码没有改变)

我在测试中没有遇到任何错误,但firebase让用户知道他们遇到了这个错误

之前我没有使用firebase控制台进行调试。你能帮帮我吗?

**ionic info:**
    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:
    cordova (Cordova CLI) : 7.1.0

local packages:
    @ionic/app-scripts : 3.1.5
    Cordova Platforms  : none
    Ionic Framework    : ionic-angular 3.9.2

System:
    Node : v8.9.3
    npm  : 5.6.0
    OS   : Windows 10

firebase console error image

 Exception java.lang.NoSuchMethodError: No virtual method getActiveNotifications()[Landroid/service/notification/StatusBarNotification;
     

在类Landroid / app / NotificationManager中;或者它的超级课程   ('android.app.NotificationManager'的声明出现在   /system/framework/framework.jar)   de.appplant.cordova.plugin.notification.Manager.getIdsByType   (Manager.java:227)   de.appplant.cordova.plugin.notification.Manager.getByType   (Manager.java:279)   de.appplant.cordova.plugin.notification.Manager.clearAll   (Manager.java:160)   de.appplant.cordova.plugin.localnotification.LocalNotification.clearAll   (LocalNotification.java:350)   de.appplant.cordova.plugin.localnotification.LocalNotification.access $ 900   (LocalNotification.java:59)   de.appplant.cordova.plugin.localnotification.LocalNotification $ 1.run   (LocalNotification.java:164)   java.util.concurrent.ThreadPoolExecutor.runWorker   (ThreadPoolExecutor.java:1112)   java.util.concurrent.ThreadPoolExecutor中的$ Worker.run   (ThreadPoolExecutor.java:587)java.lang.Thread.run(Thread.java:818)

**package.json (dependencies):**
"@angular/common": "5.1.1",
"@angular/compiler": "5.1.1",
"@angular/compiler-cli": "5.1.1",
"@angular/core": "5.1.1",
"@angular/forms": "5.1.1",
"@angular/http": "5.1.1",
"@angular/platform-browser": "5.1.1",
"@angular/platform-browser-dynamic": "5.1.1",
"@ionic-native/android-permissions": "^4.5.2",
"@ionic-native/app-rate": "^4.5.2",
"@ionic-native/core": "4.5.2",
"@ionic-native/file": "^4.5.2",
"@ionic-native/file-transfer": "^4.5.2",
"@ionic-native/firebase": "^4.5.2",
"@ionic-native/local-notifications": "^4.5.2",
"@ionic-native/native-audio": "^4.1.0",
"@ionic-native/native-storage": "^4.5.2",
"@ionic-native/network": "^4.5.2",
"@ionic-native/splash-screen": "4.5.2",
"@ionic-native/status-bar": "4.5.2",
"@ionic/storage": "2.1.3",
"cordova-android": "7.0.0",
"cordova-plugin-android-permissions": "^1.0.0",
"cordova-plugin-app-event": "^1.2.1",
"cordova-plugin-apprate": "^1.3.0",
"cordova-plugin-badge": "^0.8.5",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-device": "^1.1.7",
"cordova-plugin-dialogs": "^1.3.3",
"cordova-plugin-file": "^5.0.0",
"cordova-plugin-file-transfer": "^1.7.0",
"cordova-plugin-firebase": "^0.1.25",
"cordova-plugin-globalization": "^1.0.7",
"cordova-plugin-inappbrowser": "^1.7.1",
"cordova-plugin-local-notification": "^0.9.0-beta.1",
"cordova-plugin-nativeaudio": "^3.0.9",
"cordova-plugin-nativestorage": "^2.2.2",
"cordova-plugin-network-information": "^1.3.4",
"cordova-plugin-splashscreen": "^4.1.0",
"cordova-plugin-statusbar": "^2.3.0",
"cordova-plugin-whitelist": "^1.3.3",
"de.appplant.cordova.plugin.local-notification": "^0.8.5",
"ionic-angular": "3.9.2",
"ionic-audio": "^3.2.0",
"ionic-plugin-keyboard": "^2.2.1",
"ionic2-super-tabs": "^4.1.4",
"ionicons": "3.0.0",
"rxjs": "5.5.5",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"

**package.json (cordova plugins):**
  "cordova-plugin-console": {},
  "cordova-plugin-device": {},
  "cordova-plugin-splashscreen": {},
  "cordova-plugin-statusbar": {},
  "cordova-plugin-whitelist": {},
  "ionic-plugin-keyboard": {},
  "cordova-plugin-nativeaudio": {},
  "cordova-plugin-network-information": {},
  "cordova-plugin-file-transfer": {},
  "cordova-plugin-file": {},
  "cordova-plugin-android-permissions": {},
  "cordova-plugin-firebase": {},
  "cordova-plugin-apprate": {},
  "cordova-plugin-nativestorage": {},
  "de.appplant.cordova.plugin.local-notification": {},
  "cordova-plugin-local-notification": {}

编辑-1

  • 删除了node_modules文件
  • 删除了所有本地通知包
  • 安装了“cordova-plugin-local-notification”:“^ 0.9.0-beta.1”
  • 设置通知期'munite'

完成这些后我在adroid上测试了。应用程序崩溃并关闭。 我知道错误正在显示通知。

  • 我清理了所有通知和应用程序。

我认为这个软件包与cordova 7.0.0不兼容。 已经在包版本中是测试版。 我想我会等待兼容的版本出来......

i think this github issue is same as my problem

1 个答案:

答案 0 :(得分:0)

目前Ionic Native不支持此插件的0.9。*版本which brings breaking changes。此外,您有两个不同版本的插件:

"cordova-plugin-local-notification": "^0.9.0-beta.1",
"de.appplant.cordova.plugin.local-notification": "^0.8.5",

删除测试版并再次尝试。另外,请take a look on this thread cordova-plugin-firebase 可能会导致您的问题。