My card view elevation stopped working and showing shadow after I updated my android studio 3.3 and migrating my project to androidx artifacts.
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="@dimen/card_margin"
app:cardCornerRadius="@dimen/card_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!--Other Code-->
</LinearLayout>
</androidx.cardview.widget.CardView>