skip to Main Content

When I adding firebase library to gradle file I got error , I found many posts same this but not work to me.

Module

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.yourpackgage.test"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'com.google.android.material:material:1.1.0-alpha08'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    //Butter Knife
    implementation 'com.jakewharton:butterknife:10.1.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
    //Admob
    implementation 'com.google.android.gms:play-services-ads:18.1.0'
    //Google Auth
    implementation 'com.google.android.gms:play-services-auth:17.0.0'
    //Facebook Auth
    implementation 'com.facebook.android:facebook-login:5.1.0'
    //Firebase
    implementation 'com.google.firebase:firebase-core:17.0.1'
    implementation 'com.google.firebase:firebase-firestore:20.1.0'
    //Picasso
    implementation 'com.squareup.picasso:picasso:2.71828'
}

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

Project

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath 'com.jakewharton:butterknife-gradle-plugin:10.1.0'
        classpath 'com.google.gms:google-services:4.3.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

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

Error when adding firebase library

WARNING: API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
Affected Modules: app

I appreciate help anyone , thank you……………………………………………………………………………………………….

2

Answers


  1. This is a known issue of com.google.gms:google-services:4.3.0. As it is just a warning, it can be safely ignored – you’ll just need to eventually upgrade to a newer version of the plugin once it becomes available before the deprecated Gradle API is removed.

    Login or Signup to reply.
  2. Set your google play services like

    com.google.gms:google-services:4.2.0
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search