# OneSignal Plugin Not Installed Ionic 3 - Android Only

**URL:** <https://forum.ionicframework.com/t/onesignal-plugin-not-installed-ionic-3-android-only/140444>\
**Category:** ionic-v3\
**Created:** [September 1, 2018, 6:35pm UTC](https://forum.ionicframework.com/t/onesignal-plugin-not-installed-ionic-3-android-only/140444 "2018-09-01T18:35:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonahGizer](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@JonahGizer](https://forum.ionicframework.com/u/JonahGizer)\
**Post date:** [September 1, 2018, 6:35pm UTC](https://forum.ionicframework.com/t/onesignal-plugin-not-installed-ionic-3-android-only/140444/1 "2018-09-01T18:35:36Z")

</div>

I have an Ionic project running. Its at that point where its gotten quite large and every now and then I get some plugin issues where uninstalling and reinstalling them fixes the issue, however Ionic Native OneSignal has given me the biggest problems. It runs perfectly on all iOS devices (up to v 11.4.1), but on android (tested on android 9 and android 8.1.0) I get a plugin not installed error.

I have followed the standard approach to adding one signal to the project:

```auto
$ ionic cordova plugin add onesignal-cordova-plugin
$ npm install --save @ionic-native/onesignal

```

It seems that after narrowing it down to when exactly the error gets thrown its by the methods

```auto
this.oneSignal.handleNotificationReceived().subscribe(data => {});
this.oneSignal.handleNotificationOpened().subscribe(data => {});

```

Init seems to be called successfully. So does inFocusDisplaying.

Obviously these are very important methods for successfully using OneSignal. Im not sure why they would work with iOS but fail on android.

This has completely halted our releases and moving forward with other development. Because this code takes place before the root is set, it fails and the root never gets set. We can obviously move things around or pull it out to make the app functional but thats not how we want to solve this problem.

Any help would be greatly appreciated. Let me know if you need more info.

Info

app.component

```auto
constructor(private oneSignal: OneSignal){
 this.platform.ready().then(() => {
    this.initializePluginValues();
});
}

 public initializePluginValues(): void {
    if (this.platform.is('cordova')) {
      this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT);
      this.keyboard.hideKeyboardAccessoryBar(false);
      this.splashScreen.hide();
      this.initializeOneSignal();
    }
  }
 
public initializeOneSignal(): void {
    this.oneSignal.startInit(oneSignalAppId, oneSignalSenderId);
    this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.None);
    this.handleNotifications();
    this.oneSignal.endInit();
  }

//This is whats failing!! Both methods fail individually as well as together

 private handleNotifications(): void {
    this.oneSignal.handleNotificationReceived().subscribe(data => {
    });
    this.oneSignal.handleNotificationOpened().subscribe(data => {
    });
  }

```

config.xml

```auto
    <plugin name="onesignal-cordova-plugin" spec="^2.4.3" />

```

package.json  
dependencies: {  
“@ionic-native/onesignal”:"^4.12.2",  
“onesignal-cordova-plugin”:"^2.4.3",  
}  
plugins: {  
“onesignal-cordova-plugin”: {}  
}

versions

```auto
Ionic:

   ionic (Ionic CLI) : 4.0.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework : ionic-angular 3.9.2
   @ionic/app-scripts : 3.1.9

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms : android 7.0.0

System:

   ios-deploy : 1.9.2
   NodeJS : v8.11.1 (/usr/local/bin/node)
   npm : 6.3.0
   OS : macOS High Sierra
   Xcode : Xcode 9.4.1 Build version 9F2000

Environment:

   ANDROID_HOME : not set

```

---

<div class="post-metadata">

**Author:** ![orcasystemssarl](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/orcasystemssarl/32/81400_2.png) [@orcasystemssarl](https://forum.ionicframework.com/u/orcasystemssarl)\
**Post date:** [September 3, 2018, 2:04pm UTC](https://forum.ionicframework.com/t/onesignal-plugin-not-installed-ionic-3-android-only/140444/2 "2018-09-03T14:04:10Z")

</div>

me too , think there is probleme on sqlite-plugin

---

<div class="post-metadata">

**Author:** ![JonahGizer](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@JonahGizer](https://forum.ionicframework.com/u/JonahGizer)\
**Post date:** [September 12, 2018, 5:17pm UTC](https://forum.ionicframework.com/t/onesignal-plugin-not-installed-ionic-3-android-only/140444/3 "2018-09-12T17:17:22Z")

</div>

Why would sqlite be affecting one signal?

---

<div class="post-metadata">

**Author:** ![JonahGizer](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@JonahGizer](https://forum.ionicframework.com/u/JonahGizer)\
**Post date:** [September 12, 2018, 6:48pm UTC](https://forum.ionicframework.com/t/onesignal-plugin-not-installed-ionic-3-android-only/140444/4 "2018-09-12T18:48:24Z")

</div>

I did two things that seemed to have resolved this, at least for now.  
I removed ionic Cordova keyboard plugin and I upgraded android Cordova version from 7.0.0 to 7.1.1.  
My guess is the android update fixed it, but its worth noting that those are the only two diffs between a consistently working vs a consistently breaking version

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:18pm UTC](https://forum.ionicframework.com/t/onesignal-plugin-not-installed-ionic-3-android-only/140444/5 "2021-07-19T21:18:10Z")

</div>


