true

I found the following question: Failed to resolve: com.android.support:customtabs:[26.0.0,26.1.0] People marked it as duplicate (which is wrong ! see next sentence) or wrote something about Maven or cleaning project etc.

I have exactly the same problem for two days (failed to resolve customtabs and support-v4) and I did not change anything in my project which has been previously working. So I started looking for possible solutions and I found the problem - it is the OneSignal dependency - when I remove it, everything works fine. But I have already implemented notifications in my app - and don't know what to do now. I tried to compile the newest one (mentioned on OneSignal page)

compile 'com.onesignal:OneSignal:[3.6.0,3.99.99)'

But the result is same. Can anyone help?

UPDATE:

The problem can be very easy reproduced - please create a simple project and add this dependency mentioned below (it is from official OneSignal website https://documentation.onesignal.com/v3.0/docs/android-sdk-setup):

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

UPDATE 2:

These are my dependencies:

compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.firebaseui:firebase-ui-database:1.1.0'
compile 'com.android.support:design:25.3.1'
compile 'com.onesignal:OneSignal:[3.6.0, 3.99.99]'

Adding

maven {
        url "https://maven.google.com"
    }

to the build.gradle solved the problem with OneSignal, but now I have a problem with Firebase:

java.lang.NoSuchMethodError: No static method zzdD(Ljava/lang/String;)Z in class Lcom/google/android/gms/common/util/zzv; or its super classes (declaration of 'com.google.android.gms.common.util.zzv' 
upvote
  flag
post both gradle files root and app – akshay_shahane

3 Answers 11

Remove 'f' from dependency. also, use [ brackets instead of ). its a typo.

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

and this code in your root gradle file

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}
upvote
  flag
this was written accidentally in the question, thank you for posting, now I corrected it. Dependency is correct in the project so your answer doesnt help. – jreft56
upvote
  flag
see its typo compile 'com.onesignal:OneSignal:[3.6.0,3.99.99f99)' – akshay_shahane
upvote
  flag
use [ ] , not [ ) – akshay_shahane
upvote
  flag
? I said this was only accedintally put character here in the question! the dependency in project is exactly as you wrote it – jreft56
upvote
  flag
No this has nothing with it. See official documentation - there must be [ at the beginning and ) at the end – jreft56
upvote
  flag
post your gradle files – akshay_shahane
upvote
  flag
did you try to put this dependency in a project ? see my update – jreft56
upvote
  flag
doing that only wait – akshay_shahane
upvote
  flag
gott same problem but resolved after adding . allprojects { repositories { jcenter() maven { url "maven.google.com"; } } }. in root gardle – akshay_shahane
upvote
  flag
have you tried it ? – akshay_shahane
upvote
  flag
yes, see update – jreft56
upvote
  flag
thank you, upvoted – jreft56

The error happens because you have some conflicted library in your dependency.

As in the documentation, it says:

Automatic Dependencies
OneSignal automatically adds the following dependencies;

  • com.google.android.gms - Version 11
  • com.android.support - Version 26

Please makes sure your project matches these versions if you run into a mismatch version error.

For more details see the All gms/firesbase libraries must use the exact same version specification section.

So, you need to remove or use the same dependencies in your project, something like this:

compile 'com.android.support:appcompat-v7:26.0.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:11.0.+'
compile 'com.google.firebase:firebase-database:11.0.+'
compile 'com.firebaseui:firebase-ui-database:1.1.0'
compile 'com.android.support:design:26.0.+'
compile 'com.onesignal:OneSignal:[3.6.0, 3.99.99]'
upvote
  flag
thank you, upvoted – jreft56
upvote
  flag
he is already using the same versions of firebase dependencies – akshay_shahane
upvote
  flag
Can I add it with another version of the support library, 26.0.0-alpha1 for example ? – ILYAS_Kerbal
upvote
  flag
I think you can, but you need to exclude the support library in. Something like this compile ('com.onesignal:OneSignal:[3.6.0, 3.99.99]') { exclude group: 'com.android.support', module: 'appcompat-v7' } – ישו אוהב אותך

I just exclude the 'com.android.support' and it worked for me. Paste this in build.gradle (app level)

compile ('com.onesignal:OneSignal:[3.6.0, 3.99.99]')
        {
            exclude group: 'com.android.support'
        }

Not the answer you're looking for? Browse other questions tagged or ask your own question.