带电容器的离子性本地通知:找不到NotificationCompat

时间:2020-07-28 13:37:50

标签: android ionic-framework gradle android-support-library localnotification

我正在尝试将IonicNative LocalNotifications(https://ionicframework.com/docs/native/local-notifications/)与Ionic 5上的电容器一起使用。 当我尝试在android上运行该应用时,Android Studio会引发错误:

Error-Message: cannot find symbol class NotificationCompat

该错误发生在模块“ capacitor-cordova-android-plugins”中。在相应的function updateCountdown() { var timeLeft = Math.round(vid.duration) - Math.round(vid.currentTime); if (timeLeft == 10 && shown == false) { console.log(timeLeft) // here i want to trigger the css shown = true }else if (timeLeft < 2) { vid.removeEventListener('timeupdate', updateCountdown); // here i want to relase the css back } } 中实现了支持库:

enter image description here

如何使该应用编译?我真的不知道从哪里开始,所以请告诉我,如果您需要任何进一步的信息。

1 个答案:

答案 0 :(得分:1)

Jetifier解决此问题,作为解决方案。

基本上,您需要更新到AndroidX

npm i jetifier
npx jetifier

电容器docs的更多信息