Android Lint 消息 : Update to Fragment 1. 3.0 在分析/检查代码中使用 ActivityResult API 错误

标签 android android-studio lint

运行 Android Studio/分析/检查代码时... 我收到 50 多条相同的错误消息“Android/Lint/Correctness Error 在这行代码中将 Fragment 版本升级到至少 1.3.0":

class MainActivity :  AppCompatActivity() {...

registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->...

代码在断点处中断,因此代码被调用并且应用程序正常工作。

构建gradle包括(Kotlin语言)

implementation "androidx.activity:activity-ktx:1.2.1"
implementation "androidx.fragment:fragment-ktx:1.3.1"
debugImplementation "androidx.fragment:fragment-testing:1.3.1"

我想修复错误消息(而不是隐藏它)。由于代码工作正常,而且我使用的是 fragment-ktx:1.3.1,我应该寻找什么?

最佳答案

这已在 Google 的问题跟踪器上报告,我引用:

This has been fixed internally and will be available in the next Activity release.

来源:https://issuetracker.google.com/issues/182388985#comment9

关于Android Lint 消息 : Update to Fragment 1. 3.0 在分析/检查代码中使用 ActivityResult API 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66671278/

相关文章:

c++ - 基类 'Interpreter' 没有非析构函数虚函数

python - 无法完全禁用 python linting Pylance VSCODE

ruby-on-rails - 用于 Rails 应用程序的 Lint

android - Xamarin.Forms 获取 Mono.Linker.MarkException : Error processing method when compiling in release mode

java - 在 android 中关闭应用程序时,Java 类的实例不会变为 null

android-studio - AVD Manager IceCreamSandwich x86 图片不可下载

android - 我可以使用 Android Studio 为 Android Studio 制作插件吗?

java - 如何将 Facebook 登录和电子邮件注册添加到我的 Google Cloud Endpoints 应用程序 (Java)?

android - 将应用程序中的图像设置为墙纸

android - 无法复制 list