Skip to content Skip to sidebar Skip to footer

Error: In Adding Firebase Storage Dependency To Android Studio Project?

I have created a Firestore Project in Android Studio. In which I have Firebase Authorization implemented and that is working absolutely fine. I am able to push documents to Firesto

Solution 1:

Have you added these to your root level gradle file?

buildscript {

    dependencies {
        classpath 'com.google.gms:google-services:4.0.1' 
    }
}

allprojects {

    repositories {
        google() 
    }
}

Solution 2:

You have to add dependencies {classpath 'com.google.gms:google-services:4.0.1'} and repositories { google()} on your root level build.gradle file. Have you added that? And further more please provide your whole build.gradle file in order to understand your problem .

Solution 3:

Upgrade the following:

 implementation 'com.google.firebase:firebase-firestore:16.0.0'
 implementation 'com.google.firebase:firebase-auth:15.1.0'

into this:

 implementation 'com.google.firebase:firebase-firestore:17.0.2'
 implementation 'com.google.firebase:firebase-auth:16.0.2'

Check here for more info:

https://firebase.google.com/support/release-notes/android

Solution 4:

Also you can use firebase assitant set up

enter image description here

Solution 5:

I was able to make it work guys. You can simply compare my new gradle files. The issue was conflicting google services libraries and gradle version. So, I created new project and just added dependencies again like this and it worked.

So, I removed this from app/build.gradle:

implementation 'com.google.android.gms:play-services-auth:15.0.1'

And, removed this from module/build.gradle:

classpath 'com.google.android.gms:play-services-base:15.0.1'

and updated gradle version in module/build.gradle:

classpath 'com.google.gms:google-services:4.0.1'

New build.gradle files look like this.

module/build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.gms:google-services:4.0.1'// google-services plugin// NOTE: Do not place your application dependencies here; they belong// in the individual module build.gradle files
    }
}

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

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

app/build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "master.firebasesetup"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation 'com.google.firebase:firebase-firestore:17.0.2'
    implementation 'com.google.firebase:firebase-auth:16.0.2'
    implementation 'com.google.firebase:firebase-storage:16.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.1'
}
apply plugin: 'com.google.gms.google-services'

Post a Comment for "Error: In Adding Firebase Storage Dependency To Android Studio Project?"