Android Studio 3.1 EditText StackOverflowError [英] Android Studio 3.1 EditText StackOverflowError
问题描述
更新到Android Studio 3.1之后,当EditText成为焦点时,我将面临异常
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?
更新:
经过研究后,我发现StackOverflowError出现了带有简单EditText的不同堆栈跟踪:
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)
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)
即使在WebView中输入文本也会导致此错误
Even entering text in WebView causing this error
在AS 3.0中,EditText正常工作
In AS 3.0 EditText's worked normal
推荐答案
@evi 指出存在高级配置文件中的错误。
现在将其禁用(编辑配置设置->配置文件->启用高级配置)防止EditText崩溃
For now disabling it (Edit configuration settings -> Profiling -> Enable advanced profiling) prevents EditText from crashing
更新:
再次提供高级配置!
这篇关于Android Studio 3.1 EditText StackOverflowError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!