2

Edit please read my question properly, as the one you say is duplicate of, didnt solve my problem!

Edit 2 please im saying it again, although the solutions to that question didnt solve my problem, why you keep saying its duplicate?!!!!

im having the same problem as this : Failed to resolve: com.google.firebase:firebase-core:16.0.1 i have done everything as in the answers! but still the problem persist!

here is my gradle project level

buildscript {

    repositories {
        google()
        jcenter()
        mavenCentral()


    }

    dependencies {


        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.gms:google-services:4.0.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

and here is my gradle app level:

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

apply plugin: 'com.android.application'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

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

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.miran3ma.wequest"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
         testInstrumentationRunner     "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true

        manifestPlaceholders = [onesignal_app_id               : "my-id",
                                   dashboard, local value is ignored.
                                onesignal_google_project_number: "REMOTE"]
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation 'com.onesignal:OneSignal:3.8.4'

    implementation('com.github.thekhaeng:pushdown-anim-click:1.0.7') {
        exclude group: 'com.android.support'
    }

    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.android.support:support-vector-drawable:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-crash:16.0.0'
    implementation 'com.google.firebase:firebase-auth:16.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.0'
    testImplementation 'junit:junit:4.12'
    implementation 'com.valdesekamdem.library:md-toast:0.9.0'
    implementation 'com.facebook.android:facebook-android-sdk:4.30.0'
    implementation 'com.google.maps.android:android-maps-utils:0.5'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'net.steamcrafted:load-toast:1.0.12'
    implementation 'info.hoang8f:android-segmented:1.0.6'
    implementation 'com.google.android.gms:play-services-location:15.0.1'
    implementation 'me.grantland:autofittextview:0.2.1'
    // implementation 'com.wang.avi:library:2.1.3'

    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.sothree.slidinguppanel:library:3.4.0'

    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

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

the problem only appears after updating to the latest firebase version which is 16.

any help will be appreciated, Thanks

Community
  • 1
  • 1
Mahamad Husen
  • 229
  • 1
  • 13
  • 2
    Possible duplicate of [Failed to resolve: com.google.firebase:firebase-core:16.0.1](https://stackoverflow.com/questions/50586177/failed-to-resolve-com-google-firebasefirebase-core16-0-1) – MetaColon Jun 11 '18 at 21:41
  • its not a duplicate ! please read the my question, as the answers didnt solve my problem! – Mahamad Husen Jun 11 '18 at 21:55
  • If it's still the same question, you shouldn't ask it again. If it's different to the other question, you shouldn't just paste a link to describe your problem but describe it in your own words. – MetaColon Jun 11 '18 at 22:04
  • clean and rebuild your project – Peter Haddad Jun 12 '18 at 06:11
  • Try to use `maven {url 'https://maven.google.com'}` in project level gradle repository – Sheikh Hasib Jun 12 '18 at 07:54
  • @MetaColon im saying in plain words the answers to the questions didnt solve my problem! i had to ask the question again – Mahamad Husen Jun 12 '18 at 08:48
  • @PeterHaddad already did that, no luck! – Mahamad Husen Jun 12 '18 at 08:51
  • @HasibAkter i used this and now im using only google() as its the same thing. – Mahamad Husen Jun 12 '18 at 08:53
  • (try to remove the auth and the database dependency)anyway I copied all your dependencies=>build the project=>no error – Peter Haddad Jun 12 '18 at 09:41
  • @PeterHaddad its so strange, i even tried with another project, same error, could the issue be with linux? cuz im using ubunto? im really tired, its been for two days im struggling with this error! – Mahamad Husen Jun 12 '18 at 12:36
  • Try being tired of life – Peter Haddad Jun 12 '18 at 12:37
  • 1
    removed the auth and database, still the same! i think for now i should stick with version 15 ! – Mahamad Husen Jun 12 '18 at 12:40
  • Exactly I have the same issue with firebase-core version 16.0.1 @MahamadHusen had. Version down to 15.0.0 has no dependency issue as he mentioned. – Lipi Jul 10 '18 at 03:50
  • @Lipi yeah that is right, it looks so strange, i have done what the other answers said but sstill no look,google-service and gradle version are both up-to-date. im curretly sticked to 15.0.1 unwillingly – Mahamad Husen Jul 10 '18 at 15:48

2 Answers2

4
allprojects {
    repositories {
        jcenter()
        // Add this code block on your app
        maven {
            url "https://maven.google.com" // Google's Maven repository
        }
    }
}
ueminiscan
  • 91
  • 2
  • already tried this solution, but still for some reason , the gradle assumes that im using a higher version, See :[GradleError](https://i.imgur.com/txBQk4r.png) – Mahamad Husen Jun 19 '18 at 11:13
  • I have also encountered similar problems. Problems were resolved when I installed the current version of android studio. I can recommend it to you. – ueminiscan Jun 20 '18 at 11:42
  • By the way, in the new version it has been replaced with compile word implementation. – ueminiscan Jun 20 '18 at 11:44
  • im using the latest version of android studio, everything is the up to date,even my friend has the same problem, its implementation, see my Gradle code above – Mahamad Husen Jun 20 '18 at 12:11
  • Can u send to me your project? Maybe I can help you better. – ueminiscan Jun 20 '18 at 12:55
  • well i reall cant share it, sorry about that, but i have already shared my Gradle code above, and i think that is enough – Mahamad Husen Jun 20 '18 at 13:10
0

Just for someone having the same problem, its related to OneSignal libraries importing. just read the latest onesignal documentation on adding it so the gradle and the error shall go away.

Mahamad Husen
  • 229
  • 1
  • 13