After updating to Android Studio 3.1 I'm facing exception when EditText in focus
E/AndroidRuntime: FATAL EXCEPTION: main
Process: <package>, PID: 18938
java.lang.StackOverflowError: stack size 8MB
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
at android.view.inputmethod.InputConnectionWrapper.getTextBeforeCursor(InputConnectionWrapper.java:46)
Any idea how to fix this?
Update:
After some research I found out that StackOverflowError appears with different stacktraces with simple EditText:
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"/>
When trying to enter any symbol I get:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: <package>, PID: 21122
java.lang.StackOverflowError: stack size 8MB
at android.view.inputmethod.InputConnectionWrapper.beginBatchEdit(InputConnectionWrapper.java:106)
When I press back:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: <package>, PID: 21280
java.lang.StackOverflowError: stack size 8MB
at android.view.inputmethod.InputConnectionWrapper.finishComposingText(InputConnectionWrapper.java:78)
Even entering text in WebView causing this error
In AS 3.0 EditText's worked normal
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…