failed to find style 'cardView Style' in current theme

前端 未结 4 1161
鱼传尺愫
鱼传尺愫 2020-12-29 01:22

After updating support library version 27.1.0 Android Studio unable to render CardView. It shows error message as

failed to fi         


        
4条回答
  •  别那么骄傲
    2020-12-29 01:51

    updating the CardView from 27.1.1 to 28.0.0-alpha3 fixed the XML preview for me on AS 3.1.3.

    implementation "com.android.support:cardview-v7:28.0.0-alpha3"
    

    it still complains, but it renders the preview.

    there's also a new androidx class now, which should be the same:

    implementation "androidx.cardview:cardview:1.0.0"
    

    when updating com.android.support:design to 28.0.0-alpha3, it hints for:

    The resource @style/CardView is marked as private in com.android.support:design
    

    downgrading back to API 27 with buildTools 27.0.3 & supportLibrary 27.1.1 also prevents the issues. might upgrade to 28.0.0 with Android Studio 3.2 then.

提交回复
热议问题