没有静态方法dispatchUnhandledKeyEventPre

时间:2018-07-07 06:53:08

标签: kotlin androidx

每当我按下返回按钮或菜单按钮时,我的应用就会崩溃。我正在使用androidx和kotlin。下面是我的日志

  

07-06 18:47:25.538 22303-22303 / com.mnkafe.mnkafe E / InputEventSender:   异常分派完成信号。 07-06 18:47:25.538   22303-22303 / com.mnkafe.mnkafe E / MessageQueue-JNI:异常   MessageQueue回调:handleReceiveCallback 07-06 18:47:25.558   22303-22303 / com.mnkafe.mnkafe E / MessageQueue-JNI:   java.lang.NoSuchMethodError:没有静态方法   dispatchUnhandledKeyEventPre(Landroid / view / View; Landroid / view / KeyEvent;)Z   在Landroidx / core / view / ViewCompat类中;或其超一流   (“ androidx.core.view.ViewCompat”的声明出现在   /data/app/com.mnkafe.mnkafe-2/split_lib_dependencies_apk.apk)           在androidx.appcompat.app.AppCompatDelegateImpl.dispatchKeyEvent(AppCompatDelegateImpl.java:1162)           在androidx.appcompat.app.AppCompatDelegateImpl $ AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:2529)           在com.android.internal.policy.impl.PhoneWindow $ DecorView.dispatchKeyEvent(PhoneWindow.java:2301)           在android.view.ViewRootImpl $ ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4032)           在android.view.ViewRootImpl $ ViewPostImeInputStage.onProcess(ViewRootImpl.java:3987)           在android.view.ViewRootImpl $ InputStage.deliver(ViewRootImpl.java:3549)           在android.view.ViewRootImpl $ InputStage.onDeliverToNext(ViewRootImpl.java:3602)           在android.view.ViewRootImpl $ InputStage.forward(ViewRootImpl.java:3568)           在android.view.ViewRootImpl $ AsyncInputStage.forward(ViewRootImpl.java:3685)           在android.view.ViewRootImpl $ InputStage.apply(ViewRootImpl.java:3576)           在android.view.ViewRootImpl $ AsyncInputStage.apply(ViewRootImpl.java:3742)           在android.view.ViewRootImpl $ InputStage.deliver(ViewRootImpl.java:3549)           在android.view.ViewRootImpl $ InputStage.onDeliverToNext(ViewRootImpl.java:3602)           在android.view.ViewRootImpl $ InputStage.forward(ViewRootImpl.java:3568)           在android.view.ViewRootImpl $ InputStage.apply(ViewRootImpl.java:3576)           在android.view.ViewRootImpl $ InputStage.deliver(ViewRootImpl.java:3549)           在android.view.ViewRootImpl $ InputStage.onDeliverToNext(ViewRootImpl.java:3602)           在android.view.ViewRootImpl $ InputStage.forward(ViewRootImpl.java:3568)           在android.view.ViewRootImpl $ AsyncInputStage.forward(ViewRootImpl.java:3718)           在android.view.ViewRootImpl $ ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:3879)           在android.view.inputmethod.InputMethodManager $ PendingEvent.run(InputMethodManager.java:2242)           在android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1879)           在android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1870)           在android.view.inputmethod.InputMethodManager $ ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2219)           在android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)           在android.os.MessageQueue.nativePollOnce(本地方法)           在android.os.MessageQueue.next(MessageQueue.java:143)           在android.os.Looper.loop(Looper.java:122)           在android.app.ActivityThread.main(ActivityThread.java:5348)           在java.lang.reflect.Method.invoke(本机方法)           在java.lang.reflect.Method.invoke(Method.java:372)           在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:947)           在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:742)07-06   18:47:25.558 22303-22303 / com.mnkafe.mnkafe D / Android运行时:正在关闭   VM 07-06 18:47:25.568 22303-22303 / com.mnkafe.mnkafe   E / AndroidRuntime:致命异常:main       流程:com.mnkafe.mnkafe,PID:22303       java.lang.NoSuchMethodError:没有静态方法dispatchUnhandledKeyEventPre(Landroid / view / View; Landroid / view / KeyEvent;)Z   在Landroidx / core / view / ViewCompat类中;或其超一流   (“ androidx.core.view.ViewCompat”的声明出现在   /data/app/com.mnkafe.mnkafe-2/split_lib_dependencies_apk.apk)           在androidx.appcompat.app.AppCompatDelegateImpl.dispatchKeyEvent(AppCompatDelegateImpl.java:1162)           在androidx.appcompat.app.AppCompatDelegateImpl $ AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:2529)           在com.android.internal.policy.impl.PhoneWindow $ DecorView.dispatchKeyEvent(PhoneWindow.java:2301)           在android.view.ViewRootImpl $ ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4032)           在android.view.ViewRootImpl $ ViewPostImeInputStage.onProcess(ViewRootImpl.java:3987)           在android.view.ViewRootImpl $ InputStage.deliver(ViewRootImpl.java:3549)           在android.view.ViewRootImpl $ InputStage.onDeliverToNext(ViewRootImpl.java:3602)           在android.view.ViewRootImpl $ InputStage.forward(ViewRootImpl.java:3568)           在android.view.ViewRootImpl $ AsyncInputStage.forward(ViewRootImpl.java:3685)           在android.view.ViewRootImpl $ InputStage.apply(ViewRootImpl.java:3576)           在android.view.ViewRootImpl $ AsyncInputStage.apply(ViewRootImpl.java:3742)           在android.view.ViewRootImpl $ InputStage.deliver(ViewRootImpl.java:3549)           在android.view.ViewRootImpl $ InputStage.onDeliverToNext(ViewRootImpl.java:3602)           在android.view.ViewRootImpl $ InputStage.forward(ViewRootImpl.java:3568)           在android.view.ViewRootImpl $ InputStage.apply(ViewRootImpl.java:3576)           在android.view.ViewRootImpl $ InputStage.deliver(ViewRootImpl.java:3549)           在android.view.ViewRootImpl $ InputStage.onDeliverToNext(ViewRootImpl.java:3602)           在android.view.ViewRootImpl $ InputStage.forward(ViewRootImpl.java:3568)           在android.view.ViewRootImpl $ AsyncInputStage.forward(ViewRootImpl.java:3718)           在android.view.ViewRootImpl $ ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:3879)           在android.view.inputmethod.InputMethodManager $ PendingEvent.run(InputMethodManager.java:2242)           在android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1879)           在android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1870)           在android.view.inputmethod.InputMethodManager $ ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2219)           在android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)           在android.os.MessageQueue.nativePollOnce(本地方法)           在android.os.MessageQueue.next(MessageQueue.java:143)           在android.os.Looper.loop(Looper.java:122)           在android.app.ActivityThread.main(ActivityThread.java:5348)           在java.lang.reflect.Method.invoke(本机方法)           在java.lang.reflect.Method.invoke(Method.java:372)           在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:947)           在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:742)

1 个答案:

答案 0 :(得分:6)

检查到处都在使用1.0.0-beta01版本(适用于androidx和com.google.android ....依赖项),而不是1.0.0-alpha3