Ionic cordova app says plugin not installed even after installed

I am using onesignal-cordova-plugin in my ionic project. I have followed the documentation and added the plugin.

ionic cordova plugin add onesignal-cordova-plugin
npm install @ionic-native/onesignal

But once I build , the app log says

Native: tried calling OneSignal.startInit, but the OneSignal plugin is not installed.

I have tried removing android and readding but doesnt work. plugin list do show onesignal.


   Ionic CLI                     : 6.13.1 (/home/raj/.nvm/versions/node/v12.2.0/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.6.6
   @angular-devkit/build-angular : 0.1102.12
   @angular-devkit/schematics    : 11.2.12
   @angular/cli                  : 11.2.12
   @ionic/angular-toolkit        : 3.1.1


   Cordova CLI       : 10.0.0
   Cordova Platforms : android 9.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 7 other plugins)


   cordova-res : 0.15.3
   native-run  : 1.3.0


   Android SDK Tools : 26.1.1 (/home/raj/android/android-sdk-linux/)
   NodeJS            : v12.2.0 (/home/raj/.nvm/versions/node/v12.2.0/bin/node)
   npm               : 6.14.9
   OS                : Linux 4.4

This is probably a stupid question, but you are running this on a device, right? Cordova plugins don’t generally work when you run in a desktop browser.