解决运行安卓app时提示“Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener”
android studio run窗口中,提示异常:“Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener”解决办法:build.gradle(:app)中dependencies {...api 'androidx.appcompat:appcompat:1.0.2'...}改为dependencies {..
·
android studio run窗口中,提示异常:“Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener”
原因:
compileSdkVersion版本改到了高版本,如我当前使用的是 29,而控件依赖版本没有相应的改高,造成不匹配引起的。
解决办法:
通常是androidx开头的几项的版本改到新版本就好了。可以在安卓开发者官网查到最新版本
build.gradle(:app)中
dependencies {
...
api 'androidx.appcompat:appcompat:1.0.2'
api 'androidx.constraintlayout:constraintlayout:1.1.3'
api 'androidx.recyclerview:recyclerview:1.1.0-beta04'
...
}
改为
dependencies {
...
api 'androidx.appcompat:appcompat:1.2.0'
api 'androidx.constraintlayout:constraintlayout:2.0.4'
api 'androidx.recyclerview:recyclerview:1.1.0'
...
}
Lucky
更多推荐
已为社区贡献1条内容
所有评论(0)