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

深碍√TFBOYSˉ_ 2023-05-29 11:59 11阅读 0赞

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

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

  1. gradlew sync -Pandroid.debug.obsoleteApi=true

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

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

  1. buildscript{
  2. dependencies {
  3. // From =>
  4. classpath 'com.google.gms:google-services:4.3.0'
  5. // To =>
  6. classpath 'com.google.gms:google-services:4.2.0'
  7. }
  8. }

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

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

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

发表评论

表情:
评论列表 (有 0 条评论,11人围观)

还没有评论,来说两句吧...

相关阅读