Status Update
Comments
lp...@google.com <lp...@google.com> #2
First of all thanks for this detailed issue.
This issue had been investigated thoroughly when it was first reported internally. The surprising detail in this report is that the issue is not reproducible before 1.7
. I will look into this.
The main problem with POBox is the fact that it is deprecated. Since 2021 Sony has been shipping new Xperia devices with Gboard pre-installed. Although we are aware that there is still a considerable amount of users still using POBox, the described behavior is caused by POBox's noncompliant behavior with InputConnection
and InputMethodManager
documentation. However, this is understandable since TextView
implementation was also not respecting the behavior that is expected from Editors.
Ultimately we have decided to enforce the documented behavior with specifically regards to when editors should call InputMethodManager.updateSelection
. Also, although unconfirmed, there were traces of possible custom code being included in Sony OEM images that changed how InputMethodManager was notified from TextView. If POBox also depended on something like this, it would be impossible for Compose code to replicate the same unknown behavior.
yu...@paypay-corp.co.jp <yu...@paypay-corp.co.jp> #3
Or is that option not available?
Even if the root cause is POBox, from the perspective of the app's customers, it looks like an app bug, so this issue is a blocker against updating Jetpack Compose.
ek...@uber.com <ek...@uber.com> #4
Just to be sure, it is dangerous to replace Compose TextField with Android View EditText as a workaround for this issue.
Compose 1.7 has a bug that causes ANR when the focus is on EditText.
Another View-related bug in Compose 1.7 is that an Android View is focused by calling FocusManager.clearFocus().
Perhaps there is a lack of testing of Compose 1.7 in combination with Android View. There is also a possibility that there are other fatal bugs related to View.
In other words, the only options for apps targeting the Japanese market that require POBox support are to continue using Compose 1.6 or to use EditText in combination with various workarounds.
ek...@uber.com <ek...@uber.com> #5
Project: platform/frameworks/support
Branch: androidx-main
Author: Halil Ozercan <
Link:
Fix POBox keyboard issue
Expand for full commit details
Fix POBox keyboard issue
Fix: 373743376
Fix: 329209241
Test: NullableInputConnectionWrapperTest
Change-Id: I94e0e598274fb88b255f977f9fbd50dfbbb1ecb1
Files:
- M
compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/text/input/NullableInputConnectionWrapperTest.kt
- M
compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/NullableInputConnectionWrapper.android.kt
Hash: 57f58c4b80d5d8470b2aca325dfdcd55f235231e
Date: Thu Oct 24 01:25:20 2024
mo...@google.com <mo...@google.com> #6
Many thanks again for this report. Especially for giving us a huge clue in terms of what could be going wrong. The fix is now merged and I will ask for a cherry-pick into a stable release.
fe...@gmail.com <fe...@gmail.com> #7
Do you have any concrete plan to cherry-pick the fix into current stable version (1.7.x)? We are currently waiting it.
be...@google.com <be...@google.com> #8
Yes, this fix is planned to be included in a future 1.7.x
release.
ed...@x.com <ed...@x.com> #9
Thanks for the fix. Sorry to follow up on this. is it possible for you to share specific release version/date for the stable version? We are waiting on this to decide on our direction.
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)
```