- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
将我的应用程序升级到以下功能后,我开始收到以下错误。 (代码没变)
我在测试中没有遇到任何错误,但是 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": {}
完成这些后,我在 adroid 上进行了测试。应用程序崩溃并关闭。我知道错误是在显示通知时发生的。
我认为这个包与 cordova 7.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 可能会导致您的情况出现问题。
关于android - 没有虚拟方法 getActiveNotifications(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47866467/
将我的应用程序升级到以下功能后,我开始收到以下错误。 (代码没变) 我在测试中没有遇到任何错误,但是 firebase 让用户知道他们遇到了这个错误 我之前没有使用 firebase 控制台进行调试。
我有一个监听通知的 NotificationService 类。但是,当我调用 getActiveNotifications() 时,它会抛出 SecurityException。是的,我在调用此方法
我希望能够按需从我的 Android 应用程序中获取 Activity 通知。 (其实我只需要知道有没有)我一直在寻找这种行为,似乎我只有两个选择:NotificationManager.getAct
我正在尝试根据本教程在我的应用程序中实现 NotificationListenerService:http://www.kpbird.com/2013/07/android-notificationl
我正在使用 notificationManager.getActiveNotifications() 获取所有状态栏通知,但它只返回应用程序锁的通知。每当在 whats 应用程序或任何其他应用程序中发
我关注了这个Sample Code of kpBird还有这个Developer Guide 我可以: 调用此服务的 Intent 。 可以从通知中捕获广播。 所以我得到了错误getActiveNot
我是一名优秀的程序员,十分优秀!