3

I am creating an app which connects to firebase. But I am facing some problems. When sync my gradle files I receive this warning

WARNING: API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'.

Here are my gradle files

    //Project Level
buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath 'com.google.gms:google-services:4.3.0'


    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
   //App Level
apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.0"
    defaultConfig {
        applicationId "com.example.firebaseforme"
        minSdkVersion 16
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
apply plugin: 'com.google.gms.google-services'
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
Kunal Nk
  • 99
  • 5

2 Answers2

2

This issue is caused by the versions of the Google Services pluigin for gradle 4.3.0 and 4.3.1.

Now it is fixed with the release 'com.google.gms:google-services:4.3.2'

Here you can find more detail about the issue.

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
0

Solved to me by,

A) Go to the (project-level) build.gradle file; B) in dependencies{} set the version of google-services to an older version, like 4.2.0;

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

good luck,

Basil Rawa
  • 109
  • 1
  • 5