Подтвердить что ты не робот

Android Studio 3.1 EditText StackOverflowError

После обновления до 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)

Любая идея, как это исправить?

Обновить:

После некоторых исследований я обнаружил, что StackOverflowError появляется с разными стеками стека с простым EditText:

<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"/>

При попытке ввода любого символа я получаю:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: <package>, PID: 21122
java.lang.StackOverflowError: stack size 8MB
    at android.view.inputmethod.InputConnectionWrapper.beginBatchEdit(InputConnectionWrapper.java:106)

Когда я нажимаю:

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, вызывающий эту ошибку

В AS 3.0 EditText работал нормально

4b9b3361

Ответ 1

Как отметил @evi, есть ошибка в расширенном профилировании.

Теперь отключить его (Изменить настройки конфигурации → Профилирование → Включить расширенное профилирование) предотвращает сбой редактора EditText

Обновить:

Исправление выпущено в Android Studio 3.1.1

Продвинутое профилирование доступно еще раз!

Ответ 2

Это, похоже, происходит только на устройствах Android 6.0, EditText отлично работает на устройствах Android 5 и Android 7. Отключить расширенное профилирование (API <26) в конфигурации запуска для меня.

Ответ 3

Android 5.1.1, такая же проблема. Кажется, ошибка в новой Android Studio. Отключение расширенного профилирования устраняет проблему для сборки отладки.

Ответ 4

Столкнулся с теми же проблемами EditText сразу после обновления до Android Studio 3.1. Попробуйте установить debuggable false в build.gradle для типа сборки отладки. Или просто переключитесь на выпуск типа сборки, поскольку по умолчанию он ложный. Это помогло в моем случае.

Обновление: подтверждение того, что отключение расширенного профилирования также исправило мою проблему.

Ответ 5

У меня была та же проблема, но после:

  • Удалите папку.idea,.gradle, gradle и заново создайте ее.
  • Очистить проект.
  • Перестроить приложение.

меня устраивает.