更新到Android Studio 3.1后,当EditText处于焦点时我面临异常
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)
Run Code Online (Sandbox Code Playgroud)
知道如何解决这个问题吗?
更新:
经过一些研究后,我发现StackOverflowError出现了不同的堆栈跟踪和简单的EditText:
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"/>
Run Code Online (Sandbox Code Playgroud)
当我尝试输入任何符号时,我得到:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: <package>, PID: 21122
java.lang.StackOverflowError: stack size 8MB
at android.view.inputmethod.InputConnectionWrapper.beginBatchEdit(InputConnectionWrapper.java:106)
Run Code Online (Sandbox Code Playgroud)
当我按下时:
E/AndroidRuntime: FATAL EXCEPTION: …Run Code Online (Sandbox Code Playgroud) 在HTC D820U中调试,发现StackOverflowError.设备:HTC D820u,Android 6.0,HTC版本:1.0.0.D820u见日志:
01-11 10:55:33.101 11234-11234/com.xxx E/CrashReport:java.lang.StackOverflowError:堆栈大小为8MB,位于com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:42 )位于android.view.inputmethod.InputConnectionWrapper的com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82). com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)中的commitText(InputConnectionWrapper.java:82)位于com的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)位于com.android.tools.profiler.support.event的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)上的.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43) .InputConnectionWrapper.commitText(InputCo nnectionWrapper.java:43)在android.view上的com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)位于android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java)的com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)中的.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82) :82)位于com.android.tools的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)的com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43).在com.android.tools.profiler.support.event.InputConnectionWrappe的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)上的profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)r.commitText(InputConnectionWrapper.java:43)位于com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)位于android.view.inputmethod.InputConnectionWrapper.commitText的com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82) (InputConnectionWrapper.java:82)com的com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)位于com的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82). android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)位于com.android.tools.profiler.support.event的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82).一世 位于com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)中的nputConnectionWrapper.commitText(InputConnectionWrapper.java:43)位于android.view.inputmethod.InputConnectionWrapper.commitText的com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82) (InputConnectionWrapper.java:82)com的com.android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)位于com的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82). android.tools.profiler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.java:43)位于com.android.tools.prof的android.view.inputmethod.InputConnectionWrapper.commitText(InputConnectionWrapper.java:82)iler.support.event.InputConnectionWrapper.commitText(InputConnectionWrapper.j 01-11 10:55:33.101 11234-11234/com.xxx E/CrashReport:
++++++++++++++++++++++++++++++++++++++++++
关于日志,关于我的应用程序没有崩溃.这是Android的错误吗?还是HTC Rom的bug?