INFO: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileP

INFO: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'.

in terminal. Go to view -> tool windows -> Terminal in Android Studio.

gradlew sync -Pandroid.debug.obsoleteApi=true

可以看到具体的错误信息。

 

搜索了一段时间后,我发现这个警告是由于使用了最新版本的google-services plugin(版本4.3.0)引起的。顺便说一下,我在我的应用程序中使用这个插件来实现Firebase功能。我所做的只是在build.gradle(项目)级别文件中降级了buildscript中的google-services插件:

buildscript{
    dependencies {
       // From =>
       classpath 'com.google.gms:google-services:4.3.0'
       // To =>
       classpath 'com.google.gms:google-services:4.2.0'
    }
}

或者修改 Google Services version 在你的 build.gradle 中:

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

书到用时方恨少,纸上得来终觉浅。共勉。

posted @ 2019-11-06 10:18  冷冷清清风风火火是我  阅读(59)  评论(0)    收藏  举报