We have a crash where user copies a text from a `TextField` in our `compose`-based application, and ...
d
We have a crash where user copies a text from a
TextField
in our
compose
-based application, and Android crashes our app with a
SecurityException
because some other app doesn't have
READ_CLIPBOARD
permission. Stack trace has compose api inside. Can this somehow be disabled for
TextField
? Should I report a bug? Stacktrace in the thread.
👀 1
Copy code
Fatal Exception: java.lang.SecurityException: ru.dublgis.dgismobile from uid 10372 not allowed to perform READ_CLIPBOARD
       at android.os.Parcel.createException(Parcel.java:2074)
       at android.os.Parcel.readException(Parcel.java:2042)
       at android.os.Parcel.readException(Parcel.java:1990)
       at android.content.IClipboard$Stub$Proxy.setPrimaryClip(IClipboard.java:293)
       at android.content.ClipboardManager.setPrimaryClip(ClipboardManager.java:106)
       at androidx.compose.ui.platform.AndroidClipboardManager.setText(AndroidClipboardManager.java:34)
       at androidx.compose.foundation.text.selection.TextFieldSelectionManager.copy$foundation_release(TextFieldSelectionManager.java:413)
       at androidx.compose.foundation.text.selection.TextFieldSelectionManager.copy$foundation_release$default(TextFieldSelectionManager.java:409)
       at androidx.compose.foundation.text.selection.TextFieldSelectionManager$showSelectionToolbar$copy$1.invoke(TextFieldSelectionManager.java:514)
       at androidx.compose.foundation.text.selection.TextFieldSelectionManager$showSelectionToolbar$copy$1.invoke(TextFieldSelectionManager.java:513)
ru.dublgis.dgismobile
is not our app, it's some random app on the user's phone. but stack trace is for our app, you can see compose-related calls there.
I would put try/catch there, but it's all happening inside TextField code...
z
Does that not happen if you use an
EditText
instead of a
TextField
?