无法在当前主题中找到样式'coordinatorLayoutStyle'在Android Studio 3.1中 [英] Failed to find style 'coordinatorLayoutStyle' in current theme In 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 28
到 compileSdkVersion 27
targetSdkVersion 28
到 targetSdkVersion 27
We need to change the android { ... }
in "build.gradle" in app file
compileSdkVersion 28
to compileSdkVersion 27
targetSdkVersion 28
to targetSdkVersion 27
此外,尝试更改
等实现
code> implementation'com.android.support:appcompat -v7:28.0.0-alpha3'到
实现'com.android.support:appcompat-v7:27.1.1'$c $ c>
希望这有效!
对于 Android Studio v3.1。* ,另外我们需要更改:
实现'com.android.support:design:28.0.0-alpha3'
到
实现'com.android.sup port: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屋!