androidionic-frameworkgradleandroid-support-librarylocalnotification

Ionic LocalNotifications with Capacitor: Cannot find NotificationCompat


I'm trying to use IonicNative LocalNotifications (https://ionicframework.com/docs/native/local-notifications/) with Capacitor on Ionic 5. When I try to run the app on android, Android Studio throws an error:

Error-Message: cannot find symbol class NotificationCompat

The error occurs in module 'capacitor-cordova-android-plugins'. In the corresponding build.gradle the support library is implemented:

enter image description here

How can I make this app compile? I really don't know where to start, so please tell me, if you need any further information.


Solution

  • Jetifier fix this, as a solution.

    Basically you need to update to AndroidX

    npm i jetifier
    npx jetifier
    

    More from Capacitor's docs