Crash on email detection in TextInput on Xiaomi devices running android 10
See original GitHub issueXiaomi devices running android 10 show a little popup with the Text Frequent email
when they detect a valid email address in the text input currently selected. This feature causes some crashes on my react native app. Sadly I can’t reproduce in on an empty project, but it always happens on some inputs in my app. I have not been able to determine the difference between the textinputs that causes the problem and the textinput that does not cause any crash.
React Native version: 0.61.2
Steps To Reproduce
- Select a textinput
- digit a valid email address (such as
test@test.com
). As soon as I type the lastc
(creating a valid email format), the app crashed
The error:
java.lang.NullPointerException · Attempt to invoke direct method ‘void android.widget.Editor$SelectionModifierCursorController.initDrawables()’ on a null object reference
The full stack trace:
java.lang.NullPointerException: Attempt to invoke direct method 'void android.widget.Editor$SelectionModifierCursorController.initDrawables()' on a null object reference
at android.widget.Editor$SelectionModifierCursorController.access$300(Editor.java:6696)
at android.widget.Editor.getEmailPopupWindow(Editor.java:1469)
at android.widget.Editor.showEmailPopupWindow(Editor.java:1477)
at android.widget.Editor.handleEmailPopup(Editor.java:1456)
at android.widget.Editor.updateCursorPosition(Editor.java:2099)
at android.widget.TextView.getUpdatedHighlightPath(TextView.java:7813)
at android.widget.TextView.onDraw(TextView.java:7998)
at android.view.View.draw(View.java:21472)
at android.view.View.updateDisplayListIfDirty(View.java:20349)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4396)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:20309)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4396)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:20309)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4396)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:20309)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4396)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:20309)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4396)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:20309)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4396)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:20309)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4396)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:20309)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4396)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:20309)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4396)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:20309)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4396)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:20309)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4396)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:20309)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4396)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:20309)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4396)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:20309)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4396)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:20309)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4396)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:20309)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4396)
2019-11-12 17:19:57.876 20111-20111/com.yourvoice.ccApp.dev E/AndroidRuntime: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4369)
at android.view.View.updateDisplayListIfDirty(View.java:20309)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:575)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:581)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:654)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3687)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3482)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2819)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1782)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7785)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1031)
at android.view.Choreographer.doCallbacks(Choreographer.java:854)
at android.view.Choreographer.doFrame(Choreographer.java:789)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1016)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:221)
at android.app.ActivityThread.main(ActivityThread.java:7520)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:70
- Comments:80 (3 by maintainers)
Top Results From Across the Web
Crash on email detection in TextInput on ... - Stack Overflow
Some developers get it working playing with the 'editable' prop in TextInput const [editable, setEditable] = React.useState(false) React.
Read more >Crash on email detection in TextInput on Xiaomi devices ...
When we type email address on input box we are getting error as follows: ... Crash on email detection in TextInput on Xiaomi...
Read more >Xiaomi Android 10 crashes when typing in an email address
We are developing an Android App, having the same problem of having problems with the EditText view. It happens exclusively on Xiaomi Redmi...
Read more >Nullpointerexception In Textinputlayout On Xiaomi ... - ADocLib
Crash on email detection in TextInput on Xiaomi devices running android 10. 2020-09-21 02:32 Sumit Srivastava imported from Stackoverflow. [ ...
Read more >Frame rate - Android Developers
For example, an app playing a 24Hz video that calls setFrameRate() may result in the device changing the display refresh rate from 60Hz...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had to set
caretHidden
to true and it’s not crashing the app now (tested on Redmi K30). The downside is you can’t use the context menu actions. I am okay though with the trade off (for now) considering I’ll be using it only on email address inputs.My hack: