Cannot resolve class RelativeLayout, TextView, ImageView, LinearLayout,

First: Let’s first introduce the conditions for this situation:

The Android studio version is: Android Studio Flamingo | 2022.2.1 Patch 2

 gradle version 6.5-all


build version:gradle:3.6.4

 It started fine, but then all the xmls suddenly became popular, and the editing completion prompts disappearedCannot resolve class RelativeLayout, TextView, ImageView, LinearLayout,

 Solution: After searching a lot of information, I found that deleting the cache is feasible.

1. Depend on the source code path of the library and delete the corresponding version.
        Sometimes you need to delete the corresponding source code file, otherwise the code you see may still be the same as before.
   Users/username/.gradle/caches/transforms-2/files-2.1 对应库的文件夹

2. Then Sync Project

Reference links:

Mac Android Studio deletes cached dependent libraries

Cannot resolve class TextView, ImageView, LinearLayout,

Guess you like

Origin blog.csdn.net/chengzhenjia/article/details/130945448