[Redmi K20 Pro / Xiaomi Mi 9T Pro Questions & Answe] sumit2406:
When we type email address on input box we are getting error as follows:

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:6726)
at android.widget.Editor.getEmailPopupWindow(Editor.java:1476)
at android.widget.Editor.showEmailPopupWindow(Editor.java:1484)
at android.widget.Editor.handleEmailPopup(Editor.java:1463)
at android.widget.Editor.updateCursorPosition(Editor.java:2106)
at android.widget.TextView.getUpdatedHighlightPath(TextView.java:7824)
at android.widget.TextView.onDraw(TextView.java:8009)
at android.view.View.draw(View.java:21628)
at android.view.View.updateDisplayListIfDirty(View.java:20497)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4409)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4382)
at android.view.View.updateDisplayListIfDirty(View.java:20457)
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:3713)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3508)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2845)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1800)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7792)
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:224)
at android.app.ActivityThread.main(ActivityThread.java:7560)
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)

We tried to fix it by adding following code

import { Platform, TextInput } from 'react-native';

const { Version } = Platform;

const brandsNeedingWorkaround = ['redmi', 'xiaomi', 'poco', 'pocophone'];
const needsXiaomiWorkaround = brandsNeedingWorkaround.includes(RNInfo.getBrand().toLowerCase())
&& Version > 28;

const InputTextWrapper = forwardRef(({ onFocus, caretHidden, ...others }, ref) => {
const [hackCaretHidden, setHackCaretHidden] = useState(needsXiaomiWorkaround ? true : caretHidden);

const handleFocus = useCallback(() => {
if (needsXiaomiWorkaround) {
setHackCaretHidden(caretHidden);
}
if (onFocus) onFocus();
}, [onFocus, caretHidden]);

return (
<TextInput
ref={ref}
{...others}
onFocus={handleFocus}
caretHidden={hackCaretHidden}
/>
);
});

But still it is not working. Please provide us a solution to fix this issue.