Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
Thank you for reporting this issue. We’ve shared this with our product and engineering teams and will continue to provide updates as more information becomes available.
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #4
God bless you, unknown Google developer.
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 09a87685c459896deb8f152376b2460c5d759891
Author: Jeremy Woods <jbwoods@google.com>
Date: Fri Jul 31 13:47:02 2020
Ensure check fails on all calls to regsiterForActivityResult
Although fixing one of the errors will fix them all, we should still
make sure we show the errors on all of the calls to
registerForActivityResult, not just the last one.
Test: added test
Bug: 162155191
Change-Id: I28c694547c71ebd97576cf2786e7154cccdf3d22
M activity/activity-lint/src/main/java/androidx/activity/lint/ActivityResultFragmentVersionDetector.kt
M activity/activity-lint/src/test/java/androidx/activity/lint/ActivityResultFragmentVersionDetectorTest.kt
https://android-review.googlesource.com/1384201
Branch: androidx-master-dev
commit 09a87685c459896deb8f152376b2460c5d759891
Author: Jeremy Woods <jbwoods@google.com>
Date: Fri Jul 31 13:47:02 2020
Ensure check fails on all calls to regsiterForActivityResult
Although fixing one of the errors will fix them all, we should still
make sure we show the errors on all of the calls to
registerForActivityResult, not just the last one.
Test: added test
Bug: 162155191
Change-Id: I28c694547c71ebd97576cf2786e7154cccdf3d22
M activity/activity-lint/src/main/java/androidx/activity/lint/ActivityResultFragmentVersionDetector.kt
M activity/activity-lint/src/test/java/androidx/activity/lint/ActivityResultFragmentVersionDetectorTest.kt
jb...@google.com <jb...@google.com> #7
This has been fixed internally and will be available in the Activity-alpha08 release.
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-main
commit 3a770fd029c9c0c62b745c55b240b8f3f07e4b94
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Dec 20 21:51:17 2023
Remove code path for older lint versions and reflection
When the ActivityResultFragmentVersionDetector was written there had
been recent changes in the lint API that required it to be supported in
2 incompatiable lint versions (see b/162155191 ). That was over 3 years
and 4 lint versions ago, but it required the use of some unsafe
reflection.
Enough time has passed that it is reasonable to expect that most people
using the latest version of the Activity library are also using some
more recent version of lint.
We can clean up this rule by removing the old lint path and relying
directly on lint API instead of reflection.
This also reenables some tests that were failing due to bugs in previous
lint versions.
RelNote: "The `InvalidFragmentVersionForActivityResult` lint check will
now only work on AndroidStudio versions 4.1.0+."
Test: reenabled tests
Bug: 317158163
Fixes: 293517205
Change-Id: I84933f5cd66e5f4e699ccc6663a4d25cd4138049
M activity/activity-lint/src/main/java/androidx/activity/lint/ActivityResultFragmentVersionDetector.kt
M activity/activity-lint/src/test/java/androidx/activity/lint/ActivityResultFragmentVersionDetectorTest.kt
https://android-review.googlesource.com/2886313
Branch: androidx-main
commit 3a770fd029c9c0c62b745c55b240b8f3f07e4b94
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Dec 20 21:51:17 2023
Remove code path for older lint versions and reflection
When the ActivityResultFragmentVersionDetector was written there had
been recent changes in the lint API that required it to be supported in
2 incompatiable lint versions (see
and 4 lint versions ago, but it required the use of some unsafe
reflection.
Enough time has passed that it is reasonable to expect that most people
using the latest version of the Activity library are also using some
more recent version of lint.
We can clean up this rule by removing the old lint path and relying
directly on lint API instead of reflection.
This also reenables some tests that were failing due to bugs in previous
lint versions.
RelNote: "The `InvalidFragmentVersionForActivityResult` lint check will
now only work on AndroidStudio versions 4.1.0+."
Test: reenabled tests
Bug: 317158163
Fixes: 293517205
Change-Id: I84933f5cd66e5f4e699ccc6663a4d25cd4138049
M activity/activity-lint/src/main/java/androidx/activity/lint/ActivityResultFragmentVersionDetector.kt
M activity/activity-lint/src/test/java/androidx/activity/lint/ActivityResultFragmentVersionDetectorTest.kt
Description
This code snippet will no longer work with lint tools
27.1.0+
(which is what's used in AGP 4.1.0+).It looks like it should be changed to
buildVariant
, and then there are changed APIs for accessing library info (the.libraries
call at the end will also need fixing).This results in the following failure when I build with newer lint tools and AGP 4.1.0-beta05 in our project