16

This is Screen shot

enter image description here

I've facing this problem can anyone help me? I search everywhere, but I can't find the solution

Failed to resolve: firebase-common Open File
Failed to resolve: firebase-iid-interop Open File
Failed to resolve: firebase-measurement-connector Open File

And Im Using classpath 'com.android.tools.build:gradle:3.1.3' classpath 'com.google.gms:google-services:4.0.1' my Gradle File :

apply plugin: 'com.android.application'
android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
      applicationId "com.*****"
      minSdkVersion 15
      targetSdkVersion 27
      versionCode 20
      versionName "2.0"

      multiDexEnabled true
    }

    buildTypes {
      release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
    }
}

// Maven Repositories
repositories {

  google()
  mavenCentral()
  flatDir { dirs 'libs' }
  maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
  maven { url "https://bitbucket.org/adscend/androidsdk/raw/master/" }
  maven { name "Fyber's maven repo"
        url "https://fyber.bintray.com/maven" }

}

dependencies {

  // test Libraries
  implementation fileTree(include: ['*.jar'], dir: 'libs')
  testImplementation 'junit:junit:4.12'

  // Android Support Libraries
  implementation 'com.android.support:design:27.1.1'
  implementation 'com.android.support:support-v4:27.1.1'
  implementation 'com.android.support:customtabs:27.1.1'
  implementation 'com.android.support:cardview-v7:27.1.1'
  implementation 'com.android.support:appcompat-v7:27.1.1'
  implementation 'com.android.support:mediarouter-v7:27.1.1'
  implementation 'com.android.support:support-vector-drawable:27.1.1'

  // Adnetwork Libraries
  implementation 'com.fyber:fyber-sdk:8.19.0'
  implementation(name: 'adgatemediasdk', ext: 'aar')
  implementation(name: 'OfferToroSdk-v3.1.10', ext: 'aar')
  implementation 'com.adscendmedia.sdk:adscendmedia:2.3.4'
  implementation 'com.ironsource.sdk:mediationsdk:6.7.4@jar'

  // MultiDex Dependency
  implementation 'com.android.support:multidex:1.0.3'

  // Other Libraries
  implementation 'com.squareup.okio:okio:1.14.0'
  implementation 'com.google.code.gson:gson:2.8.1'
  implementation 'com.nineoldandroids:library:2.4.0'
  implementation 'com.squareup.okhttp3:okhttp:3.10.0'
  implementation 'com.squareup.picasso:picasso:2.5.2'
  implementation 'de.hdodenhof:circleimageview:2.2.0'
  implementation 'com.mcxiaoke.volley:library:1.0.18'
  implementation 'com.github.d-max:spots-dialog:0.7@aar'
  implementation 'com.github.paolorotolo:appintro:4.1.0'
  implementation 'org.apache.httpcomponents:httpclient-android:4.3.5'
  implementation 'com.facebook.network.connectionclass:connectionclass:1.0.1'

  // Facebook Login only
  implementation 'com.facebook.android:facebook-login:4.34.0'

  // slider library
  implementation 'com.daimajia.slider:library:1.1.5@aar'

  // Google Libraries
  implementation 'com.google.firebase:firebase-messaging:17.1.0'
  implementation 'com.google.firebase:firebase-auth:16.0.2'
  implementation 'com.google.firebase:firebase-analytics:16.0.1'

  // Firebase
  implementation 'com.google.firebase:firebase-ads:15.0.1'
  implementation 'com.google.firebase:firebase-messaging:17.1.0'

}

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

Thanks you .

M.Ricciuti
  • 11,070
  • 2
  • 34
  • 54

4 Answers4

50

You need to put google() repository BEFORE jcenter().

This is because Google removed their projects from jcenter, but erroneously left some artifacts with dependencies.

buildscript {
    repositories {
        google()
        jcenter()
    }

...

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}
Borzh
  • 5,069
  • 2
  • 48
  • 64
18

As of the June 12th release of the Firebase SDK, you must explicitly include firebase-core:

Your app gradle file now has to explicitly list com.google.firebase:firebase-core as a dependency for Firebase services to work as expected.

Add:

implementation 'com.google.firebase:firebase-core:16.0.1'
wrozwad
  • 2,610
  • 1
  • 30
  • 38
Bob Snyder
  • 37,759
  • 6
  • 111
  • 158
  • 6
    Thank You So Much Bob Snyder For Your Aswer. when i add `implementation 'com.google.firebase:firebase-core:16.0.1'` it's not solve but when i Clean The Project i HAve A New Error `Could not find firebase-common.aar` then i find the solution here [link]https://stackoverflow.com/questions/48242111/gradle-error-after-update-com-android-toolssdk-common And It's Working Now!!!! Thank you so much for your Help :) – Akram Ibna Bashar Nihan Jul 05 '18 at 19:22
  • If you are still having the problem like me, make sure you use the latest: `implementation 'com.google.firebase:firebase-core:16.0.6'`. `16.0.1` still gives the error. – zed Dec 07 '18 at 13:38
6

Update the dependencies version to the latest one. Worked for me.

Naman Kaushik
  • 61
  • 1
  • 1
2

As @Borzh suggested, adding google() repository before jcenter() repo worked for me. Please note this change has to be done at both "project level gradle file "(top level build file) and module level build file.

Project level build.gradle file

allprojects {
        repositories {
            google()
            jcenter()
        }
    }

Module level build.gradle file

repositories {
    google()
    jcenter()
}
Shiva
  • 543
  • 1
  • 6
  • 20