无法在当前主题中找到样式“coordinatorLayoutStyle"在 Android Studio 3.1 中 [英] Failed to find style 'coordinatorLayoutStyle' in current theme In Android Studio 3.1

查看:32
本文介绍了无法在当前主题中找到样式“coordinatorLayoutStyle"在 Android Studio 3.1 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android Studio 3.1 布局预览在当前主题中找不到样式coordinatorLayoutStyle".

The Android Studio 3.1 layout preview fails to find style 'coordinatorLayoutStyle' in the current theme.

Failed to instantiated one or more classes.
 Exception shown are :-
java.lang.ClassNotFoundException: android.view.View$OnUnhandledKeyEventListener

推荐答案

这是由于使用了 alpha 版本 SDK 28

我们需要更改应用文件中build.gradle"中的android { ... }
compileSdkVersion 28compileSdkVersion 27
targetSdkVersion 28targetSdkVersion 27

We need to change the android { ... } in "build.gradle" in app file
compileSdkVersion 28 to compileSdkVersion 27
targetSdkVersion 28 to targetSdkVersion 27

此外,尝试更改实现,例如
实现'com.android.support:appcompat-v7:28.0.0-alpha3'
实现'com.android.support:appcompat-v7:27.1.1'

Also, try to change implementations like
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3' to
implementation 'com.android.support:appcompat-v7:27.1.1'

希望这有效!

对于 Android Studio v3.1.*,我们还需要更改:
实现 'com.android.support:design:28.0.0-alpha3'
实现'com.android.support:design:27.1.1'

For Android Studio v3.1.*, in addition we need change:
implementation 'com.android.support:design:28.0.0-alpha3' to
implementation 'com.android.support:design:27.1.1'

这篇关于无法在当前主题中找到样式“coordinatorLayoutStyle"在 Android Studio 3.1 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆