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

前端 未结 6 1727
无人共我
无人共我 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:20

    Update

    1. com.android.support:appcompat stable version 28.0.0 is released. So no need to downgrade version. Just use 28.0.0.

    def supportVersion = "28.0.0"
    implementation "com.android.support:appcompat-v7:$supportVersion"
    implementation "com.android.support:design:$supportVersion"
    

    You can ignore design library if you don't need it.

    2: You also need to update your compileSdkVersion & targetSdkVersion to remove some gradle warnings.

    compileSdkVersion 28
    targetSdkVersion 28
    

    Never use alpha versions of any library, because alpha, beta and rc versions may have bugs. And you don't want to face these types of errors often.

    Important Suggestion

    I suggest you migrate to androidx because android will not update support library after 28.0.0, all updates will be available to androidx package only. Check related answer.

提交回复
热议问题