gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 03:31:44 24 4
gpt4 key购买 nike

运行 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com