Status Update
Comments
da...@gmail.com <da...@gmail.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.
co...@gmail.com <co...@gmail.com> #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.
cl...@google.com <cl...@google.com>
an...@google.com <an...@google.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.
da...@gmail.com <da...@gmail.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
co...@gmail.com <co...@gmail.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.
an...@google.com <an...@google.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.
co...@gmail.com <co...@gmail.com> #8
Yes, this fix is planned to be included in a future 1.7.x
release.
an...@google.com <an...@google.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.
ap...@google.com <ap...@google.com> #10
Branch: androidx-main
commit dd000ea5e6eb3a8f07b869595ca62aa2fb781d12
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Mon Feb 22 19:42:13 2021
Fix for broken rememberSaveable { mutableStateOf(0) } with navigation-compose
Previously we were converting MutableState into a parcelable structure only for a direct child of the saving list. It was incorrect as SaveableStateHolder used in navigation is wrapping the state of the screen as a value into a Map. Now we will recursively iterate through List/Maps and covert all inner MutableState objects.
Fixes: 180042685
Fixes: 180701630
Test: new tests in ActivityRecreationTest
Relnote: Fix for broken rememberSaveable { mutableStateOf(0) } when used inside a destination of navigation-compose.
Change-Id: I1312b5b210dde32250945d164a2f3a1b574cb0a8
M compose/runtime/runtime-saveable/src/androidAndroidTest/AndroidManifest.xml
M compose/runtime/runtime-saveable/src/androidAndroidTest/kotlin/androidx/compose/runtime/saveable/ActivityRecreationTest.kt
M compose/runtime/runtime-saveable/src/commonMain/kotlin/androidx/compose/runtime/saveable/RememberSaveable.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/DisposableSaveableStateRegistry.android.kt
an...@google.com <an...@google.com> #11
ba...@gmail.com <ba...@gmail.com> #12
It looks like this bug has been re-introduced in 1.0
an...@google.com <an...@google.com> #13
el...@kroger.com <el...@kroger.com> #14
Hi I am seeing this same issue using navigation-compose version 2.5.2, we tried the suggestions from this thread from 2021 but they did not work. The stack trace looks like this:
java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = [Landroidx.compose.runtime.MutableState;)
at android.os.Parcel.writeSerializable(Parcel.java:1833)
at android.os.Parcel.writeValue(Parcel.java:1780)
at android.os.Parcel.writeList(Parcel.java:1045)
at android.os.Parcel.writeValue(Parcel.java:1729)
at android.os.Parcel.writeMapInternal(Parcel.java:896)
at android.os.Parcel.writeMap(Parcel.java:878)
at android.os.Parcel.writeValue(Parcel.java:1694)
at android.os.Parcel.writeMapInternal(Parcel.java:896)
at android.os.Parcel.writeMap(Parcel.java:878)
at android.os.Parcel.writeValue(Parcel.java:1694)
at android.os.Parcel.writeList(Parcel.java:1045)
at android.os.Parcel.writeValue(Parcel.java:1729)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:928)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1584)
at android.os.Bundle.writeToParcel(Bundle.java:1253)
at android.os.Parcel.writeBundle(Parcel.java:997)
at android.os.Parcel.writeValue(Parcel.java:1698)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:928)
...
at android.app.IActivityTaskManager$Stub$Proxy.activityStopped(IActivityTaskManager.java:4505)
at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:145)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: java.io.NotSerializableException: androidx.compose.runtime.ParcelableSnapshotMutableState
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1240)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1434)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1230)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:354)
at android.os.Parcel.writeSerializable(Parcel.java:1828)
at android.os.Parcel.writeValue(Parcel.java:1780)
at android.os.Parcel.writeList(Parcel.java:1045)
at android.os.Parcel.writeValue(Parcel.java:1729)
at android.os.Parcel.writeMapInternal(Parcel.java:896)
at android.os.Parcel.writeMap(Parcel.java:878)
...
an...@google.com <an...@google.com> #15
If you can file a new bug with the reproducible code sample we will be able to take a look
ga...@gmail.com <ga...@gmail.com> #16
E FATAL EXCEPTION: main
Process: com.example.animeapp, PID: 12273
java.lang.RuntimeException: Parcel: unable to marshal value Color(0.83137256, 0.75686276, 0.8156863, 1.0, sRGB IEC61966-2.1)
at android.os.Parcel.writeValue(Parcel.java:1885)
at android.os.Parcel.writeList(Parcel.java:1092)
at android.os.Parcel.writeValue(Parcel.java:1832)
at android.os.Parcel.writeList(Parcel.java:1092)
at android.os.Parcel.writeValue(Parcel.java:1832)
at android.os.Parcel.writeMapInternal(Parcel.java:943)
at android.os.Parcel.writeMap(Parcel.java:925)
at android.os.Parcel.writeValue(Parcel.java:1797)
at android.os.Parcel.writeMapInternal(Parcel.java:943)
at android.os.Parcel.writeMap(Parcel.java:925)
at android.os.Parcel.writeValue(Parcel.java:1797)
at android.os.Parcel.writeList(Parcel.java:1092)
at android.os.Parcel.writeValue(Parcel.java:1832)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:975)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1620)
at android.os.Bundle.writeToParcel(Bundle.java:1303)
at android.os.Parcel.writeBundle(Parcel.java:1044)
at android.os.Parcel.writeValue(Parcel.java:1801)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:975)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1620)
at android.os.Bundle.writeToParcel(Bundle.java:1303)
at android.os.Parcel.writeBundle(Parcel.java:1044)
at android.os.Parcel.writeValue(Parcel.java:1801)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:975)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1620)
at android.os.Bundle.writeToParcel(Bundle.java:1303)
at android.app.IActivityTaskManager$Stub$Proxy.activityStopped(IActivityTaskManager.java:4389)
at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:145)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
an...@google.com <an...@google.com> #17
ma...@marcardar.com <ma...@marcardar.com> #18
Related to this issue, it would be useful to give more details in the log message, because when, for example, the object is a Set
we have no idea what is the underlying type (the type of the items stored in the Set
) and so have no idea where to look in the code:
Fatal Exception: java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = java.util.LinkedHashSet)
at android.os.Parcel.writeSerializable(Parcel.java:2178)
at android.os.Parcel.writeValue(Parcel.java:1944)
at androidx.compose.runtime.ParcelableSnapshotMutableState.writeToParcel(ParcelableSnapshotMutableState.kt:30)
at android.os.Parcel.writeParcelable(Parcel.java:1965)
at android.os.Parcel.writeValue(Parcel.java:1871)
at android.os.Parcel.writeList(Parcel.java:1153)
at android.os.Parcel.writeValue(Parcel.java:1893)
at android.os.Parcel.writeMapInternal(Parcel.java:1004)
at android.os.Parcel.writeMap(Parcel.java:986)
at android.os.Parcel.writeValue(Parcel.java:1858)
at android.os.Parcel.writeMapInternal(Parcel.java:1004)
at android.os.Parcel.writeMap(Parcel.java:986)
at android.os.Parcel.writeValue(Parcel.java:1858)
at android.os.Parcel.writeList(Parcel.java:1153)
at android.os.Parcel.writeValue(Parcel.java:1893)
at android.os.Parcel.writeMapInternal(Parcel.java:1004)
at android.os.Parcel.writeMap(Parcel.java:986)
at android.os.Parcel.writeValue(Parcel.java:1858)
at android.os.Parcel.writeList(Parcel.java:1153)
at android.os.Parcel.writeValue(Parcel.java:1893)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:1036)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1620)
at android.os.Bundle.writeToParcel(Bundle.java:1304)
at android.os.Parcel.writeBundle(Parcel.java:1105)
at android.os.Parcel.writeValue(Parcel.java:1862)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:1036)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1620)
at android.os.Bundle.writeToParcel(Bundle.java:1304)
at android.os.Parcel.writeBundle(Parcel.java:1105)
at android.os.Parcel.writeValue(Parcel.java:1862)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:1036)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1620)
at android.os.Bundle.writeToParcel(Bundle.java:1304)
at android.os.Parcel.writeBundle(Parcel.java:1105)
at android.os.Parcel.writeValue(Parcel.java:1862)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:1036)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1620)
at android.os.Bundle.writeToParcel(Bundle.java:1304)
at android.os.Parcel.writeBundle(Parcel.java:1105)
at android.os.Parcel.writeValue(Parcel.java:1862)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:1036)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1620)
at android.os.Bundle.writeToParcel(Bundle.java:1304)
at android.os.Parcel.writeBundle(Parcel.java:1105)
at android.os.Parcel.writeValue(Parcel.java:1862)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:1036)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1620)
at android.os.Bundle.writeToParcel(Bundle.java:1304)
at android.os.Parcel.writeBundle(Parcel.java:1105)
at android.os.Parcel.writeValue(Parcel.java:1862)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:1036)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1620)
at android.os.Bundle.writeToParcel(Bundle.java:1304)
at android.os.Parcel.writeBundle(Parcel.java:1105)
at android.os.Parcel.writeValue(Parcel.java:1862)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:1036)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1620)
at android.os.Bundle.writeToParcel(Bundle.java:1304)
at android.os.Parcel.writeBundle(Parcel.java:1105)
at android.os.Parcel.writeValue(Parcel.java:1862)
at android.os.BaseBundle.dumpStats(BaseBundle.java:1690)
at android.os.BaseBundle.dumpStats(BaseBundle.java:1727)
at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:150)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8751)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
il...@google.com <il...@google.com> #19
Re
Description
Component used: Compose Version used: 1.0.0-alpha12 Devices/Android versions reproduced on: Pixel 4 Android 11
The recommended code to replace
savedInstanceState{ 0 }
isrememberSaveable { mutableStateOf(0) }
However, I've found this causes a crash whenever the app is minimized.
The exception thrown is
java.lang.RuntimeException: Parcel: unable to marshal value androidx.compose.runtime.SnapshotMutableStateImpl@5a847c2
After digging into the code I believe this is caused by the special version of
rememberSaveable
forMutableState
objects doesn't have a default saver parameter so the normal version is used which doesn't know how to save aMutableState
.I think changing the
rememberSaveable
definition fromto
would fix this.