Search code examples
androidandroid-xmlandroidx

Android Studio does not support code completion for CardView from AndroidX, how to fix this?


I've added the Cardview to build.gradle under dependencies:

implementation 'androidx.cardview:cardview:1.0.0'

Gradle did not complain. When I try to use it in activity_main.xml, it seems to work, but for some reason, Android Studio does not offer syntax completion a CardView block. See the image below.

My Android Studio version is 3.5.3.

Any ideas what might be wrong? Sorry if this is a silly question, I'm new to Android.

enter image description here


Solution

  • This is an android studio fault that might be accurate some times. you can use Invalidate cache and restart from file menu.

    if problem not solve look at this topic