LinearLayout flagged if used in CardView
Apart from other suggestions and the above answer, this issue happenes on me if I didn't upgrade my support library to AndroidX, in this case is CardView. So from
android.support.v7.widget.CardView
will need to be change to
androidx.cardview.widget.CardView
and the warning shall now disappears.
Just to have a proper answer, as @Blacklight said in comments, it is an IDE issue so restarting it should fix the problem.