Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Keyboard (AOSP) keeps stopping with Android O emulator

I'm running into this problem when using Android keyboard with Android O emulator. It always gives me the error saying

"Android Keyboard (AOSP) has stopped"

when I'm trying to press the "?123" button from the Android keyboard, and then the keyboard closes itself. enter image description here

This issue only occurs when I'm using emulator with API 26 (Android O) in Android Studio 3.0 Canary 7. Paste the error message in the following.

08-15 16:19:41.249 12833-12833/com.android.inputmethod.latin E/AndroidRuntime: FATAL EXCEPTION: main
                                                                           Process: com.android.inputmethod.latin, PID: 12833
                                                                           com.android.inputmethod.keyboard.KeyboardLayoutSet$KeyboardLayoutSetException: java.lang.IllegalArgumentException: Empty keySpec at Binary XML file line #39
                                                                               at com.android.inputmethod.keyboard.KeyboardLayoutSet.getKeyboard(KeyboardLayoutSet.java:207)
                                                                               at com.android.inputmethod.keyboard.KeyboardSwitcher.setKeyboard(KeyboardSwitcher.java:153)
                                                                               at com.android.inputmethod.keyboard.KeyboardSwitcher.setSymbolsKeyboard(KeyboardSwitcher.java:258)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardState.setSymbolsKeyboard(KeyboardState.java:318)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardState.toggleAlphabetAndSymbols(KeyboardState.java:262)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardState.onPressSymbol(KeyboardState.java:411)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardState.onPressKey(KeyboardState.java:370)
                                                                               at com.android.inputmethod.keyboard.KeyboardSwitcher.onPressKey(KeyboardSwitcher.java:194)
                                                                               at com.android.inputmethod.latin.LatinIME.onPressKey(LatinIME.java:1666)
                                                                               at com.android.inputmethod.keyboard.PointerTracker.callListenerOnPressAndCheckKeyboardLayoutChange(PointerTracker.java:265)
                                                                               at com.android.inputmethod.keyboard.PointerTracker.onDownEventInternal(PointerTracker.java:687)
                                                                               at com.android.inputmethod.keyboard.PointerTracker.onDownEvent(PointerTracker.java:644)
                                                                               at com.android.inputmethod.keyboard.PointerTracker.processMotionEvent(PointerTracker.java:604)
                                                                               at com.android.inputmethod.keyboard.MainKeyboardView.processMotionEvent(MainKeyboardView.java:723)
                                                                               at com.android.inputmethod.keyboard.MainKeyboardView.onTouchEvent(MainKeyboardView.java:710)
                                                                               at android.view.View.dispatchTouchEvent(View.java:11721)
                                                                               at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
                                                                               at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2593)
                                                                               at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
                                                                               at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2593)
                                                                               at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
                                                                               at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2593)
                                                                               at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
                                                                               at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2593)
                                                                               at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
                                                                               at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2593)
                                                                               at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
                                                                               at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2593)
                                                                               at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
                                                                               at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2593)
                                                                               at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:445)
                                                                               at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1828)
                                                                               at android.app.Dialog.dispatchTouchEvent(Dialog.java:815)
                                                                               at android.inputmethodservice.SoftInputWindow.dispatchTouchEvent(SoftInputWindow.java:93)
                                                                               at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:407)
                                                                               at android.view.View.dispatchPointerEvent(View.java:11960)
                                                                               at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4776)
                                                                               at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4590)
                                                                               at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4128)
                                                                               at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4181)
                                                                               at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4147)
                                                                               at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4274)
                                                                               at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4155)
                                                                               at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4331)
                                                                               at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4128)
                                                                               at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4181)
08-15 16:19:41.249 12833-12833/com.android.inputmethod.latin E/AndroidRuntime:     at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4147)
                                                                               at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4155)
                                                                               at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4128)
                                                                               at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6642)
                                                                               at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6616)
                                                                               at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6577)
                                                                               at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6745)
                                                                               at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
                                                                               at android.os.MessageQueue.nativePollOnce(Native Method)
                                                                               at android.os.MessageQueue.next(MessageQueue.java:325)
                                                                               at android.os.Looper.loop(Looper.java:142)
                                                                               at android.app.ActivityThread.main(ActivityThread.java:6541)
                                                                               at java.lang.reflect.Method.invoke(Native Method)
                                                                               at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
                                                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
                                                                            Caused by: java.lang.IllegalArgumentException: Empty keySpec at Binary XML file line #39
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.load(KeyboardBuilder.java:175)
                                                                               at com.android.inputmethod.keyboard.KeyboardLayoutSet.getKeyboard(KeyboardLayoutSet.java:227)
                                                                               at com.android.inputmethod.keyboard.KeyboardLayoutSet.getKeyboard(KeyboardLayoutSet.java:204)
                                                                                ... 60 more
                                                                            Caused by: com.android.inputmethod.latin.utils.XmlParseUtils$ParseException: Empty keySpec at Binary XML file line #39
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseKey(KeyboardBuilder.java:482)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseRowContent(KeyboardBuilder.java:362)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseDefault(KeyboardBuilder.java:798)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseSwitchInternal(KeyboardBuilder.java:609)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseSwitchRowContent(KeyboardBuilder.java:595)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseRowContent(KeyboardBuilder.java:368)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseMerge(KeyboardBuilder.java:578)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseIncludeInternal(KeyboardBuilder.java:557)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseIncludeRowContent(KeyboardBuilder.java:518)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseRowContent(KeyboardBuilder.java:366)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseKeyboardContent(KeyboardBuilder.java:310)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseMerge(KeyboardBuilder.java:576)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseIncludeInternal(KeyboardBuilder.java:557)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseIncludeKeyboardContent(KeyboardBuilder.java:513)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseKeyboardContent(KeyboardBuilder.java:315)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.parseKeyboard(KeyboardBuilder.java:229)
                                                                               at com.android.inputmethod.keyboard.internal.KeyboardBuilder.load(KeyboardBuilder.java:172)
                                                                                ... 62 more

Is it a bug from the Android O side?

like image 818
laixiaoyuan Avatar asked Aug 15 '17 23:08

laixiaoyuan


People also ask

What does Android keyboard AOSP mean?

The Android Open Source Project (AOSP) is an initiative created to guide development of the Android mobile platform. The Android platform consists of the operating system (OS), middleware and integral mobile applications.

Why is my emulator not working Android studio?

If the emulator fails to launch due to the error vulkan-1. dll cannot be found , you probably need to update the emulator. To update the emulator in Android Studio, go to Tools > SDK Manager and install the latest stable version of Android platform.


1 Answers

This is a bug in the LatinIME input method in AOSP 8.0 (probably they didn't spot it because the AOSP keyboard isn't used in branded Android).

The fix is here: https://android-review.googlesource.com/#/c/platform/packages/inputmethods/LatinIME/+/469478/

like image 126
Bernhard Rosenkränzer Avatar answered Oct 10 '22 14:10

Bernhard Rosenkränzer