Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deal with these deprecation warnings by Gradle v6.3?

I updated Android Gradle Plugin to v3.6.2 and Grade to v6.3 in Android Studio. When I run a build with the compiler option --warning-mode all, I get the following two deprecation warnings:

1:

Configure project :app
Internal API constructor DefaultDomainObjectSet(Class<T>) has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use ObjectFactory.domainObjectSet(Class<T>) instead. See https://docs.gradle.org/6.3/userguide/custom_gradle_types.html#domainobjectset for more details.
    at build_gklh609eby8f87cnghyses56.run(E:\Mahalaya\app\build.gradle:1)
    (Run with --stacktrace to get the full stack trace of this deprecation warning.)

2:

Querying the mapped value of map(property(interface org.gradle.api.file.Directory, property(interface org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, E:\Mahalaya\app\build\generated\ap_generated_sources\debug\out)))) before task ':app:compileDebugJavaWithJavac' has completed has been deprecated. This will fail with an error in Gradle 7.0. Consult the upgrading guide for further information: https://docs.gradle.org/6.3/userguide/upgrading_version_6.html#querying_a_mapped_output_property_of_a_task_before_the_task_has_completed

It hasn't been a long time since I have started programming in Android, and I have no idea about what to do about these warnings. I can't understand what is being said in the links. Any help is appreciated.

Update: Gradle v6.5 shows the same warnings.

like image 604
Wrichik Basu Avatar asked Apr 02 '20 09:04

Wrichik Basu


People also ask

How do I change the Gradle version in Windows?

One way to upgrade the Gradle version is manually change the distributionUrl property in the Wrapper's gradle-wrapper. properties file. The better and recommended option is to run the wrapper task and provide the target Gradle version as described in Adding the Gradle Wrapper.

Which Gradle version should I use?

If you've updated your Android Studio to 1.3. 2 version then I would suggest using Build Tools Version 23.0. 0 and compile API 23 Android 6.0. As for Gradle Version - 2.4 or higher up to latest 2.7.


1 Answers

I think it is caused by one of these plugins. I have it too:

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

And i also think they will update these plugins as well. So that the deprecation would not be a problem.

like image 168
Numan Karaaslan Avatar answered Sep 29 '22 13:09

Numan Karaaslan