2

I have a simple application using webview. I want to use androidx and gradle 3.4.2 in my application. So that I made some changes to my gradle file. See below:

In app level gradle file:

android {
    compileSdkVersion 28
    .........
    defaultConfig {
       .........
        minSdkVersion 16
        targetSdkVersion 28
        .........
    }
   .........
}
repositories {
    mavenCentral()
}
dependencies {
    .........
    implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
    implementation 'com.google.android.material:material:1.1.0-alpha09'
    implementation 'com.google.firebase:firebase-core:17.0.1'
    implementation 'com.google.android.gms:play-services-tagmanager:17.0.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
    implementation 'com.google.firebase:firebase-perf:18.0.1'
    .........
}

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

In Project Level gradle file:

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath 'com.google.gms:google-services:4.3.0'
        classpath 'com.google.firebase:perf-plugin:1.3.0'
        classpath 'io.fabric.tools:gradle:1.31.0'
    }
}

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

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

In gradle.properties file:

systemProp.http.proxyPassword=
systemProp.http.proxyHost=.....
systemProp.http.proxyUser=.....
systemProp.http.proxyPort=8080
android.useAndroidX=true
android.enableJetifier=true

But I got some warnings after syncing my project. Project build and run successfully.I want to remove these Warnings but I don't know how to remove these warnings. May these create problem in future?
See warnings below:

First
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings

Second
BUILD SUCCESSFUL in 1s
14 actionable tasks: 3 executed, 11 up-to-date
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

Darshan
  • 4,020
  • 2
  • 18
  • 49
Sanjay Kumar
  • 1,135
  • 14
  • 27
  • Check this answer - https://stackoverflow.com/a/56848644/6819340 – Darshan Aug 01 '19 at 11:16
  • @DarShan after down grade my google-services from 4.3.0 to 4.2.0 . I am not getting SECOND warning. But still I have to face FIRST warning. What is the solution for FIRST. – Sanjay Kumar Aug 01 '19 at 11:54

1 Answers1

0

First

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.

See this reply

Second

WARNING: API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'. It will be removed at the end of 2019.

This warning message occurs because of some libraries you added in the app are using the obsolete code. You can ignore this message, it will not create any issues.

To identify which library is creating this issue, do the following,

You can include android.debug.obsoleteApi=true in gradle.properties file.

Rebuild your project and you will be able view detailed info about this issue in the logcat.

Giddy Naya
  • 4,237
  • 2
  • 17
  • 30
  • For FIRST problem if i run command gradlew --warning-mode=all in terminal than i get Same warning which is showing in SECOND problem. I guess both FIRST and SECOND problem are linked together but I dont know how to remove this warnings. – Sanjay Kumar Aug 01 '19 at 11:47
  • Not getting second warning after downgrading google-services from 4.3.0 to 4.2.0 in project level gradle. – Sanjay Kumar Aug 01 '19 at 11:56