Android Studio 3.1.4 报错Failed to find style 'coordinatorLayoutStyle' in current theme

版权声明:本文为博主原创文章,转载请注明出处。 https://blog.csdn.net/qq_29542611/article/details/82750101

使用最新版的AS3.1.4安装后 运行hello world程序,预览报错Failed to find style ‘coordinatorLayoutStyle’ in current theme。
如图。
在这里插入图片描述
网上找了些方法,没解决,然后去Google找了下,在stackoverflow上找到了解决办法。
由于这个版本的AS我安装的是28的Android SDK,据说是版本太高了,stackoverflow上说将版本该为27就好使了。附原问题链接:Stack Overflow
更改\MyApplication\app\build.gradle文件
如图:
在这里插入图片描述
compileSdkVersion 28
targetSdkVersion 28
改为
compileSdkVersion 27
targetSdkVersion 27
依赖版本号改为:
implementation ‘com.android.support:appcompat-v7:27.1.1’
implementation ‘com.android.support:design:27.1.1’
然后AS提醒你,更改后呀同步。
在这里插入图片描述
同步后查看效果,虽然还是在报错,不过已经可以预览了。
在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_29542611/article/details/82750101