Fixed
Status Update
Comments
jb...@google.com <jb...@google.com> #2
What version of Activity are you using? Upgrading your Activity dependency 1.7.2
which also depends on Lifecycle 2.6.1
should resolve this.
tp...@gmail.com <tp...@gmail.com> #3
Thanks. I stumbled upon https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:activity/activity/src/main/java/androidx/activity/ComponentDialog.kt;bpv=1;bpt=0
And see it was fixed in commit 602bac6c67b589d11f8f4d1441a4aec4dca0ee49.
Ill wait to upgrade until after that commit is in the stable release.
And see it was fixed in commit 602bac6c67b589d11f8f4d1441a4aec4dca0ee49.
Ill wait to upgrade until after that commit is in the stable release.
jb...@google.com <jb...@google.com> #4
It is stable in the releases I referenced above.
il...@google.com <il...@google.com> #5
Fragment 1.6.1 will update the dependency of Activity to 1.7.2 so you'll get this improvement by default. As mentioned above, you can add a dependency on Activity 1.7.2 right now to fix the issue as a workaround until that release comes out.
Description
Component used: Fragment, ComponentDialog
Version used: 1.6.0
Devices/Android versions reproduced on:
After upgrading androidx.fragment to 1.6.0 from 1.5.5, I am unable to compile when attempting to subclass ComponentDialog. An error is generated that says:
If I convert
MyComponentDialog
to Java, it works as expected.I copied the source code for ComponentDialog and commented out the references to ViewTreeLifecycleOwner (since I don’t have access to that) and found the compiler generated the same error for ComponentDialog itself.
In ComponentDialog, if I replace:
with
the compiler no longer complains and the class can be extended.
The problem can be easily demonstrated with the following Kotlin code:
Other than converting
MyComponentDialog
to Java, I could not find a solution.