gpt4 book ai didi

android - 没有虚拟方法 getActiveNotifications()

转载 作者:太空狗 更新时间:2023-10-29 14:41:20 24 4
gpt4 key购买 nike

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

我在测试中没有遇到任何错误,但是 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;

in class Landroid/app/NotificationManager; or its super classes (declaration of 'android.app.NotificationManager' appears in /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

最佳答案

目前 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 可能会导致您的情况出现问题。

关于android - 没有虚拟方法 getActiveNotifications(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47866467/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com