“play-services-tasks (com.google.android.gms:play-services-tasks)”的开发者向 SDK 版本 18.0.0 添加了以下备注:
play-services-tasks v18.0.0 has known issues that can lead to runtime NPEs (NullPointerException) when handling Task<Void> results in Kotlin code. We strongly recommend that you avoid using this version. This also impacts the SDKs listed in the December 9, 2021 release, because they all depend on play-services-tasks. A fix for this issue is included in play-services-tasks v18.0.1. See https://developers.google.com/android/guides/releases#december_16_2021
请使用 Google Play SDK 索引,详细了解您当前使用的 SDK 并更明智地选用 SDK。
解决方案: 升级依赖包版本:18.0.1
https://developers.google.com/android/guides/releases#december_16_2021
December 16, 2021
The latest updates to play-services-base and play-services-tasks resolve the issue that can lead to runtime NPEs (NullPointerException) when handling Task<Void> results in Kotlin code. If you're using any of the library versions listed in the December 09, 2021 release, you can avoid the runtime NPEs by explicitly depending on v18.0.1 of play-services-base and play-services-tasks. Add the following to the dependencies section of your build.gradle:
implementation 'com.google.android.gms:play-services-base:18.0.1'
implementation 'com.google.android.gms:play-services-tasks:18.0.1'
In January 2022, we plan to release new versions of the other artifacts released on December 09 with new POM dependencies on the 18.0.1 versions of play-services-base and play-services-tasks.
The latest update to Firebase includes changes to:
Firebase Android BoM (Bill of Materials)
Firebase SDK for Google Analytics
This Firebase release picks up the latest versions of play-services-base and play-services-tasks (v18.0.1) to fix the issue described in the December 09, 2021 release.
For more information, see the Firebase Android SDK Release Notes.
Artifacts released on maven.google.com
com.google.android.gms:play-services-base:18.0.1
com.google.android.gms:play-services-tasks:18.0.1
com.google.firebase:firebase-bom:29.0.3
com.google.firebase:firebase-core:20.0.2