Fixed
Status Update
Comments
ap...@google.com <ap...@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> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit be64fe99f1e6800d2df7bc1a0a5ca4ffc38a2f6a
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue Jul 07 15:09:23 2020
Make ActivityResult lint look for transitive dependencies
Instead of only looking for explicit fragment dependencies, the
ActivityResultFragmentVersionDetector should also take into
consideration transitive dependencies. This ensures we can catch older
versions in apps that use libraries like appcompat and navigation.
Test: ./gradlew bOS all exisiting tests pass
Bug: 152554847
Change-Id: Id0a3b6c69a685cc46b71f1977a348189780b385a
M activity/activity-ktx/build.gradle
M activity/activity-lint/src/main/java/androidx/activity/lint/ActivityResultFragmentVersionDetector.kt
M activity/integration-tests/testapp/build.gradle
https://android-review.googlesource.com/1356393
Branch: androidx-master-dev
commit be64fe99f1e6800d2df7bc1a0a5ca4ffc38a2f6a
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue Jul 07 15:09:23 2020
Make ActivityResult lint look for transitive dependencies
Instead of only looking for explicit fragment dependencies, the
ActivityResultFragmentVersionDetector should also take into
consideration transitive dependencies. This ensures we can catch older
versions in apps that use libraries like appcompat and navigation.
Test: ./gradlew bOS all exisiting tests pass
Bug: 152554847
Change-Id: Id0a3b6c69a685cc46b71f1977a348189780b385a
M activity/activity-ktx/build.gradle
M activity/activity-lint/src/main/java/androidx/activity/lint/ActivityResultFragmentVersionDetector.kt
M activity/integration-tests/testapp/build.gradle
jb...@google.com <jb...@google.com> #7
The new lint check can now detect the fragment library as a transitive dependency.
my...@gmail.com <my...@gmail.com> #8
This change seems to crash lint with NoSuchMethodError on Android Studio 4.1.0-beta04.
/home/circleci/code/mobile: Error: Unexpected failure during lint analysis (this is a bug in lint or one of the libraries it depends on)
Message: com.android.tools.lint.detector.api.Project.getCurrentVariant()Lcom/android/builder/model/Variant;
The crash seems to involve the detector androidx.activity.lint.ActivityResultFragmentVersionDetector.
You can try disabling it with something like this:
android {
lintOptions {
disable "InvalidFragmentVersionForActivityResult"
}
}
Stack: NoSuchMethodError:ActivityResultFragmentVersionDetector.checkDslPropertyAssignment(ActivityResultFragmentVersionDetector.kt:97)←Detector.checkDslPropertyAssignment(Detector.kt:418)←UastGradleVisitor.handleMethodCall(UastGradleVisitor.kt:190)←UastGradleVisitor.access$handleMethodCall(UastGradleVisitor.kt:34)←UastGradleVisitor$visitBuildScript$1.visitCallExpression(UastGradleVisitor.kt:40)←KotlinUFunctionCallExpression.accept(KotlinUFunctionCallExpression.kt:205)←ImplementationUtilsKt.acceptList(implementationUtils.kt:23)←UBlockExpression$DefaultImpls.accept(UBlockExpression.kt:21)
You can set environment variable LINT_PRINT_STACKTRACE=true to dump a full stacktrace to stdout. [LintError]
il...@google.com <il...@google.com> #9
Re #8 - please file a new bug with a sample project.
Description
Component used: Activity Version used: 1.2.0-alpha02
When using the
RequestPermission
orRequestPermissions
contracts, they will only work if using Fragment1.2.0-alpha02
or higher since previous versions ofFragmentActivity
did not callsuper.onRequestPermissionsResult()
(which is howComponentActivity
and henceActivityResultRegistry
get permission results).Ideally, usages of either of these contracts would show a Lint error if the user depends on an older version of Fragments since these contacts won't work. It should have a quick fix that upgrades them to a new enough version of Fragments.