0

i have been struggling with OneSignal getting the plugin to work correctly each time i try and debug I get an error such as JDK 1.8 required , or android licence agreement not accepted.

How can I solve this?

Jelly Bean
  • 1,161
  • 1
  • 11
  • 22

1 Answers1

0

I'm new to onesignal and I have come across a few common and uncommon problems with setting up Onesignal with Cordova and thought I would do a write up of my experience.

When starting you need to follow the setup guide provided by onesignal

Remember to generate keys for GCM api, Google project key, and finally onesignal project key. You will need these along the setup process.

Next: Create a Apache Cordova project -> and build Solution.

Next: Update CLI to V6.4 or higher (with this you will need to install JDK 1.8 and point to it once installed go to Tools -> Options -> Tools for Apache Cordova -> Environment variables override and point to the JDK 1.8 file)

Test your app on your device at this point it should run without problems.

Install the Onesignal plugin from GitHub OneSignal Cordova SDK. And just in case test again to see that the app still launches.

You might receive an error saying you need to accept a licence agreement for android SDK 24 for this go to Tools -> Android -> Android SDK Manager and install Android 7.0 (API 24) this will allow you to accept license agreement.

Next: follow the OneSignal Cordova Setup Guide

Once you have completed the setup go to the oneSignal dash while running the app on your device it should automatically be subscribed if you are using Android. Then send yourself a notification.

halfer
  • 19,824
  • 17
  • 99
  • 186
Jelly Bean
  • 1,161
  • 1
  • 11
  • 22
  • Just a side note if you are using VS and your application requiers a APK certificate you can have a look at [Visual Studio Tools for Apache Cordova](https://taco.visualstudio.com/en-us/docs/tutorial-package-publish-readme/) – Jelly Bean May 04 '17 at 11:48