Failed to find style 'coordinatorLayoutStyle' in current theme In Android Studio 3.1

前端 未结 6 1742
无人共我
无人共我 2020-12-01 16:47

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

Failed to instantiated one or more classes.
 Excep         


        
6条回答
  •  余生分开走
    2020-12-01 17:13

    This happened due to use of alpha version SDK 28

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

    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'

    Hope this works!

    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'

提交回复
热议问题