android – Failed to find style coordinatorLayoutStyle in current theme

android – Failed to find style coordinatorLayoutStyle in current theme

I solved this rendering problem by simply inserting this line into the application theme (the app theme is usually placed in styles.xml).

[SDK 28]

<style name=AppTheme>
  <item name=coordinatorLayoutStyle>@style/Widget.Support.CoordinatorLayout</item>
</style>

[SDK 27]

<style name=AppTheme>
  <item name=coordinatorLayoutStyle>@style/Widget.Design.CoordinatorLayout</item>
</style>

As suggested by @Chris. If the IDE does not find the CoordinatorLayout in Widget.Support or Widget.Design, just start typing CoordinatorLayout and it should give you some options.

Turns out the new SDK 28 is unfortunately introducing this error on Android Studio when you create a new project.

How to solve:

Check your build.gradle (Module: app) file and change:

compileSdkVersion 28
targetSdkVersion 28

To:

compileSdkVersion 27
targetSdkVersion 27

Also, make sure you are using the right dependencies version:

implementation com.android.support:appcompat-v7:27.1.1
implementation com.android.support:design:27.1.1

android – Failed to find style coordinatorLayoutStyle in current theme

implementation com.android.support:appcompat-v7:28.0.0-alpha3 in
build.gradle(module) change alpha 3 to alpha 1. sync and you should be good to go. I spent almost a day trying to figure this out. none of these answers worked for me. hope this helps

Leave a Reply

Your email address will not be published.