OneSignal Help & Documentation

Welcome to the OneSignal New IA developer hub. You'll find comprehensive guides and documentation to help you start working with OneSignal New IA as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Support

Troubleshooting Android

Common setup issues with Android and Amazon

Troubleshooting
For Developers

Failed to resolve: com.onesignal:onesignal:[3.6.0, 3.99.99]

This means that Android Studio or Gradle could not download our plugin. Please check the following.
1. Open your browser to http://search.maven.org/ to make sure it loads on your system.
2. Make sure you're using Android Studio version 1.4.0 or newer.
3. Go to File > Settings.
4. Search for Offline work and uncheck this option.

4. Add the following to your .gradle file.

repositories {
    mavenCentral()
}

5. Try restarting Android Studio and then going to Tools > Android > Sync Project With Gradle Files.


Error:Execution failed for task ':app:processDebugGoogleServices'.

If you are receiving the following Android Studio error when building your project

Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.

Remove the following line from your .gradle file.

apply plugin: 'com.google.gms.google-services'

Error:(22, 0) Could not find method plugins() for arguments [...] on object of type com.android.build.gradle.AppExtension

This error means you added plugins { ... } to the wrong spot in your app/build.gradle. You must have the following 3 lines at the very top of your file. Double check you don't have duplicated lines as well.

plugins {
    id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.0'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

Error: Failed to resolve: com.android.support:customtabs:[26.0.0,26.2.0) OR com.android.support:support-v4:[26.0.0,26.2.0)

Failed to resolve: com.android.support:customtabs:[26.0.0,26.1.0)
Could not resolve all dependencies for configuration ':appName:'.
   > Could not find any version that matches com.android.support:customtabs:[26.0.0,26.2.0).
     Versions that do not match:
         26.0.0-alpha1
         25.3.1
         + 19 more
     Required by:
         project :appName > com.onesignal:OneSignal:3.6.0

Please use one of the Options below to resolve the issue;

Option A

Add the new Google Maven repo to your build.gradle

repositories {
    maven { url 'https://maven.google.com' }
}

Also update compileSdkVersion to 26 in your app/build.gradle.

Option B

If you are not ready to update your project to the new support library yet and are still using targetSdkVersion 25 or lower you can follow Option A or C in the section's instructions.


Error: All gms/firesbase libraries must use the exact same version specification

All gms/firebase libraries must use the exact same version (mixing versions can lead to runtime crashes).
Found versions 11.0.4, 10.2.1.
Examples include com.google.android.gms:play-services-base:11.0.4 and com.google.android.gms:play-services-gcm:10.2.1.

OneSignal automatically adds the following dependencies;

  • com.google.android.gms - Version 11.2.+
  • com.android.support - Version 26.1.+

To fix this issue, all dependencies must be matching versions.

Option A

Add the OneSignal-Gradle-Plugin to your project.

Option B

Upgrade - Find all com.google.android.gms compile lines and update them to match.

// Update 9.0.0 to 11.2.+ so it is using the same gms version as OneSignal
compile 'com.google.android.gms:play-services-maps:9.0.0'

Option C

Downgrade - Force OneSignal's dependencies to a lower version.

// Replace gmsVersion and/or androidSupportVersion with the versions you need to downgrade to.

def gmsVersion = '11.2.+'
compile("com.google.android.gms:play-services-gcm:${gmsVersion}") {
    force = true
}
compile("com.google.android.gms:play-services-location:${gmsVersion}") {
    force = true
}

// Must use 26.0.0 or newer if you have targetSdkVersion 26
def androidSupportVersion = '26.1.+'
compile("com.android.support:support-v4:${androidSupportVersion}")  {
    force = true
}
compile("com.android.support:customtabs:${androidSupportVersion}")  {
    force = true
}

Error: java.lang.NoSuchMethodError: com.google.android.gms.common.internal.zzaa.zzb

If you see that some obfuscated Firebase or Google GMS methods are missing, it is most probably a dependency versioning conflict.

You can use the gradle dependencies and gradle dependencyInsight directives to troubleshoot which libraries are causing classes/methods to go missing. Refer to the official Gradle documentation for more information:

https://docs.gradle.org/current/userguide/tutorial_gradle_command_line.html#sec:dependency_insight

For example:

./gradlew app:dependencyInsight --configuration compile

Error:Execution failed for task ':app:processDebugManifest'

If you see the following error make sure you have completed step 1.2 correctly.

Execution failed for task ':app:processDebugManifest'
Manifest merger failed with multiple errors, see logs

No Users showing on the OneSignal dashboard

Please follow our No users on dashboard guide first.

Make sure you have your Application in your AndroidManifest.xml and add logging around OneSignal to make sure it is being called.
Make sure you have android:name=".ApplicationClass".

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme
android:name=".ApplicationClass">
public class ApplicationClass extends Application {

   @Override
   public void onCreate() {
      super.onCreate();
			
     	Log.d("OneSignalTag", "Before OneSignal init");
     
      OneSignal.setLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE);
      OneSignal.startInit(this).init();

      Log.d("OneSignalTag", "After OneSignal init");
   }
}

ERROR: AppId format is invalid

  1. Make sure you have onesignal_app_id in your build.gradle and your id is correct.
android {
   defaultConfig {
      manifestPlaceholders = [onesignal_app_id: "PUT YOUR ONESIGNAL APP ID HERE",
                              // Project number pulled from dashboard, local value is ignored.
                              onesignal_google_project_number: "REMOTE"]
    }
 }
  1. Make sure you are not replacing the <application> tag in your AndroidManifest.xml with tools:node="replace"
<application
android:icon="@mipmap/ic_launcher"
tools:node="replace" <!-- Remove this line!!! -->
android:name=".ApplicationClass">

If you must replace some attributes please use tools:replace instead tools:node.
Example: tools:replace="icon, label"


OneSignal Dependencies

OneSignal automatically includes the following dependencies;

  • com.google.android.gms - Version 11.2.+
  • com.android.support - Version 26.1.+

Since these are commonly used by other SDKs you may run into issues due to conflicting versions. Add the OneSignal-Gradle-Plugin to your project which will automatically resolve any conflicts.

1. Open your app/build.gradle (Module: app) file, add the following to the top.

plugins {
    id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.0'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

(Missing Google Play Services Library) status on the Dashboard

In Android Studio open build.gradle (Module: app) and make sure you are using the latest OneSignal SDK under dependencies.

dependencies {
    compile 'com.onesignal:OneSignal:[3.6.0, 3.99.99]'
}

How to get a crash or error log from an Android device

With Android Studio

1. Select Android Monitor from the bottom of the window.
------If you don't see this select it from View > Tool Windows > Android Monitor
2. Select your device from the drop down.
3. Ensure no filters are set and the type is set to Verbose.

4. Select all lines in the log by pressing Control + A and then copy them.
5. Paste them into a .txt file and send this to support. Include steps to reproduce the problem as well.

With the terminal / command line.

1. adb logcat -b all -d -v threadtime > onesignal_crash_logcat.txt
2. Send the onesignal_crash_logcat.txt to support. Include steps to reproduce the problem as well.

If you don't have adb in your path you will need to fully path to adb in the Android SDK. It is under <android-sdk>\platform-tools\adb.
If you don't have the Android SDK installed you can just download the SDK Platform Tools which contains the adb executable.


Android Studio - No resource found that matches the given name: attr 'android:keyboardNavigationCluster'

Make sure you have compileSdkVersion to 26 in your app/build.gradle. This is required when you update to 26 of the Android Support Library.

Eclipse - ERROR - "conversion to dalvik format failed with error 1"

If you're getting a conversion to dalvik format failed with error 1 error with Dx bad class file magic (cafebabe) or version (0033.0000) messages before this then you may have the wrong Java version set on your system. See the follow post to fix this as well as the other answers.
http://stackoverflow.com/a/9041471/1244574

Troubleshooting Android

Common setup issues with Android and Amazon

Troubleshooting
For Developers