android ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener"

I/art: Rejecting re-init on previously-failed class java.lang.Class: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
           at void android.support.v4.view.ViewCompat.setBackground(android.view.View, android.graphics.drawable.Drawable) (ViewCompat.java:2341)
           at void android.support.v7.widget.ActionBarContainer.(android.content.Context, android.util.AttributeSet) (ActionBarContainer.java:62)




 Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.qky.qingchi.myapplication-2/base.apk"],nativeLibraryDirectories=[/data/app/com.qky.qingchi.myapplication-2/lib/x86, /system/lib, /vendor/lib]]
           at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
           at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
           at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)

https://segmentfault.com/q/1010000016083287    详情看这个问题

刚下载的android studio 一切都是默认配置,报这个错,

因为项目中使用的api等级和虚拟机api等级不一致导致的, 我项目中build.gradle sdk api用的28,虚拟机用的27,然后项目中用了28中的功能,虚拟机没有这个功能,所以报错了,修改虚拟机的api等级改成28就行了

android ClassNotFoundException: Didn't find class
 

你可能感兴趣的:(android,android,studio,移动开发)