Status Update
Comments
lp...@google.com <lp...@google.com> #2
Information redacted by Android Beta Feedback.
yu...@paypay-corp.co.jp <yu...@paypay-corp.co.jp> #3
Thank you for reporting this issue. We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
ek...@uber.com <ek...@uber.com> #4
ek...@uber.com <ek...@uber.com> #5
Thank you for reporting this issue. We have a fix rolling out in an upcoming release.
mo...@google.com <mo...@google.com> #6
The fix I made was for
fe...@gmail.com <fe...@gmail.com> #7
be...@google.com <be...@google.com> #8
ed...@x.com <ed...@x.com> #9
We were never able to figure out a simple repro case, sorry. Maybe @feenixspz has one?
(our workaround was to try/catch in our base Activity's dispatchKeyEvent
and return false if something throws)
yu...@paypay-corp.co.jp <yu...@paypay-corp.co.jp> #10
Please check my example. I reproduced the crash in my pixel 6a 14. Click the edit text and then click the keyboard done.
be...@google.com <be...@google.com> #11
George, would you mind checking the example in
co...@squareup.com <co...@squareup.com> #12
mo...@google.com <mo...@google.com> #13
I am able to repro with the given project.
mo...@google.com <mo...@google.com> #14
The problem is that ComposeView assumes that its contents are focusable. As a work-around, I think that if you call view.focusable = false
after instantiation, you won't have this problem.
se...@gmail.com <se...@gmail.com> #15
What version will this be addressed in?
ek...@uber.com <ek...@uber.com> #16
+1. The workaround isn't practical for us as we have many unique ComposeViews. This issue is blocking Compose library upgrades for us.
se...@gmail.com <se...@gmail.com> #17
someone had success with getting at the AndroidComposeView
inside the ComposeView
something like this maybe - is this a legit workaround?
composeView.doOnAttach {
(it as ViewGroup).getChildAt(0).isFocusable = false
}
se...@gmail.com <se...@gmail.com> #18
Ok, so I see this note in androidx.compose.ui:ui:1.8.0-alpha03
Fixed exception thrown when the IME is active on an external View and the Next action is used to enter focus on the ComposeView. The clearFocus() behavior aligns with View behavior on API < 28, where clearFocus() can cause the default View to be focused.
So it might be fixed? Has anyone tried?
mo...@google.com <mo...@google.com> #19
The CL is still in review.
se...@gmail.com <se...@gmail.com> #20
Thanks
The fix that seems to be working for us is adding Modifier.focusable()
to the root composable in our custom AbstractComposeView
for cases where focus is needed but the crash is still happening. Verified with ComposeView
s in our app.
ta...@gotinder.com <ta...@gotinder.com> #21
Any updates on cherry picking this fix in a stable version? We are still seeing a lot of crashes for users in production.
ap...@google.com <ap...@google.com> #22
Project: platform/frameworks/support
Branch: androidx-main
Author: George Mount <
Link:
Stop crash when moving focus to ComposeView with no focusable content
Expand for full commit details
Stop crash when moving focus to ComposeView with no focusable content
Fixes: 369256395
Fixes: 378570682
Compose advertises itself as focusable. When another View finds the
ComposeView and requests focus on it, it is expected to accept the
focus and can crash if it doesn't. This CL returns true when that
happens and tries to move focus to the next item if possible.
When moving focus between ComposeViews using "Tab," the
focus was not changing. This CL fixes that problem.
Test: new test, manual testing
Change-Id: I372b6974e1b4714f825c208e683aea8d50e19116
Files:
- M
compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/focus/FocusViewInteropTest.kt
- M
compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/focus/OwnerFocusTest.kt
- M
compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
- A
compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/FocusFinderCompat.android.kt
- M
compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/focus/FocusOwnerImpl.kt
Hash: 5926b31e4bd68cee82f84f42d7223765329988b8
Date: Fri Nov 01 15:50:10 2024
ta...@gotinder.com <ta...@gotinder.com> #24
Which release is this fix available in?
g....@cmcmarkets.com <g....@cmcmarkets.com> #25
I opened a similar issue if not the same back in August. It was opened before the bug was introduced into the stable release of compose UI 1.7.0 at the end of August:
That was marked fixed for some reason and the developer suggested me to open a new issue as he was convinced that he fixed it. So I opened a new one with more details at
Now someone pointed out that there is this issue too.
ap...@google.com <ap...@google.com> #26
Project: platform/frameworks/support
Branch: androidx-main
Author: George Mount <
Link:
Fix several focus issues
Expand for full commit details
Fix several focus issues
Fixes: 369256395
Fixes: 378570682
Fixes: 376142752
Relnote: "Fixed several focus-related issues, including
crashes when IME tries to focus on ComposeView without
focusable items, focus change within child AndroidViews,
and focus request leaving an AndroidView."
Allow focus to leave AndroidView using requestFocus()
When requestFocus() is called to move focus from an
Android View within Compose to a compose focus requester,
the ComposeView should be focused and the focus target
should have focus.
This CL moves the functionality for moving focus
between child Views to the key handler, moveFocus(),
and requestFocus().
Test: new test, manual test
Change-Id: Ia03c3c04dc9fd9d55d8fcae6b15e15cb2384f467
Files:
- M
compose/ui/ui/api/current.txt
- M
compose/ui/ui/api/restricted_current.txt
- M
compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/focus/FocusViewInteropTest.kt
- M
compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/focus/OwnerFocusTest.kt
- M
compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
- A
compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/FocusFinderCompat.android.kt
- M
compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/viewinterop/AndroidViewHolder.android.kt
- M
compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/viewinterop/FocusGroupNode.android.kt
- M
compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/ComposeUiFlags.kt
- M
compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/focus/FocusOwnerImpl.kt
- M
compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/focus/FocusTransactions.kt
Hash: 1467e40d3c1253ebb6e3b54f9bfdcdc93ef53da7
Date: Mon Dec 02 18:21:31 2024
pr...@google.com <pr...@google.com> #27
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.ui:ui:1.8.0-alpha07
androidx.compose.ui:ui-android:1.8.0-alpha07
androidx.compose.ui:ui-jvmstubs:1.8.0-alpha07
androidx.compose.ui:ui-linuxx64stubs:1.8.0-alpha07
ai...@gmail.com <ai...@gmail.com> #28
Are there any plans to backport it to 1.7?
au...@google.com <au...@google.com> #29
George: what do you think about backporting this fix to 1.7? Does aosp/3329475 introduce a lot of risk?
mo...@google.com <mo...@google.com> #30
I think it is fine, but it has been reverted, so we should wait until it lands with stability.
ta...@gotinder.com <ta...@gotinder.com> #31
🙏🏼 Backporting this fix to a stable release would be greatly appreciated! Adopting an alpha version isn't available to us due to stability concerns.
ta...@gotinder.com <ta...@gotinder.com> #32
Any updates on this issue?
pr...@google.com <pr...@google.com> #33
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.ui:ui:1.8.0-alpha08
androidx.compose.ui:ui-android:1.8.0-alpha08
androidx.compose.ui:ui-jvmstubs:1.8.0-alpha08
androidx.compose.ui:ui-linuxx64stubs:1.8.0-alpha08
ek...@uber.com <ek...@uber.com> #34
Any plans to backport this to 1.7?
au...@google.com <au...@google.com> #35
removed
au...@google.com <au...@google.com> #36
Nevermind, i read this wrong.
Description
Kotlin version: 1.9.23
Steps to Reproduce or Code Sample to Reproduce:
Ours is a View interop case. (Two text fields and a Compose Button in XML layout). Clicking on IME done crashes the app with:
Stack trace (if applicable):
```
Fatal Exception: java.lang.IllegalStateException: focus search returned a view that wasn't able to take focus!
at android.widget.TextView.onKeyUp(TextView.java:10271)
at android.view.KeyEvent.dispatch(KeyEvent.java:3175)
at android.view.View.dispatchKeyEvent(View.java:15781)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.widget.ScrollView.dispatchKeyEvent(ScrollView.java:591)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.widget.ScrollView.dispatchKeyEvent(ScrollView.java:591)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1987)
at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:669)
at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:2010)
at android.app.Activity.dispatchKeyEvent(Activity.java:4595)
at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.kt:103)
at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:85)
at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.kt:117)
at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:604)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3397)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:515)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:7822)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:7679)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7058)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:7125)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:7086)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:7259)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:7094)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:7316)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7062)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:7125)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:7086)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:7094)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7062)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:10383)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:10334)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:10295)
at android.view.ViewRootImpl$ViewRootHandler.handleMessageImpl(ViewRootImpl.java:6803)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:6667)
at android.os.Handler.dispatchMessage(Handler.java:108)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:328)
at android.app.ActivityThread.main(ActivityThread.java:9239)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:594)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
```