如何处理Gradle v6.3的这些弃用警告?

6

我在Android Studio中将Android Gradle插件更新为v3.6.2,Gradle更新为v6.3。当我使用编译器选项--warning-mode all运行构建时,会出现以下两个弃用警告:

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

我刚开始学习Android编程不久,对于这些警告我毫无头绪。我无法理解链接中所说的内容,请帮帮我。

更新:Gradle v6.5也显示了相同的警告。

1个回答

3

我认为这是由其中一个插件引起的。我也遇到了这个问题:

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

我认为他们也会更新这些插件,以便淘汰不再成为问题。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接