Awesome Open Source
Awesome Open Source

OneSignal Gradle Plugin

This Gradle plugin helps make the OneSignal Android SDK compatible with your Android Studio / Gradle project. It automatically fixes and notifies you of required changes to make the OneSignal SDK compatible with your app.


  1. In your root build.gradle, under buildscript, add the following 2 new lines to your existing repositories and dependencies sections
buildscript {
    repositories {
        // ...
    dependencies {
        // ...
        // OneSignal-Gradle-Plugin
        classpath '[0.14.0, 0.99.99]'
  1. Add the following to the top of your app/build.gradle
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
  1. Android Studio - Sync gradle
  2. Clean and rebuild


  • Automatically aligns versions of module dependencies under the same group. This fixes compile and runtime errors due to mismatched interdependencies. Applies to the following libraries:
  • Ensures is never higher than compileSdkVersion
  • Ensures a compatible OneSignal SDK version for the targetSdkVersion you're using
  • Ensures new enough OneSignal SDK is included when is upgraded
  • Calculates intersecting range of 2 version ranges
    • Including backwards capability with Gradle 2.14.1
  • Future: Other warnings and checks specific to OneSignal such as app_id and notification icons


  • Recommend using AGP 3.0.0 or newer (Android Gradle Plugin) and Gradle 4.1 or newer.
    • Compatible with Gradle 2.14.1+ and AGP 2.2.3+
    • Tested up to Gradle 7.0.2 and AGP 4.2.1

Change Log

See this repository's release tags for a complete change log.


Please create a new issue on this repository's Github issue tracker for feature requests and bug reports related specifically to this plugin. For other OneSignal issues not related to this plugin please contact OneSignal support from the dashboard.


You can add --info to ./gradlew commands such as ./gradlew app:dependencies --info to see log entries of version overrides being applied.

Pull Requests

Pull requests are welcome! Please fork, create a new branch, and open a pull request. Also please add a test to MainTest.groovy verify your changes.

Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Plugin (113,704
Sdk (32,758
Gradle (12,984
Groovy (8,464
Gradle Plugin (1,663
Gcm (984
Fcm (760
Onesignal (277
Gradle Dependency (3