Intellij Cannot resolve symbol on import

前端 未结 29 1909
耶瑟儿~
耶瑟儿~ 2020-11-30 18:10

This problem happens intermittently for different libraries and different projects. When trying to import a library, the package will be recognized, but the class name can\'

29条回答
  •  囚心锁ツ
    2020-11-30 19:08

    There can be multiple reasons for this. In my case it was wrong source root issue. Invalidate caches didn't work along with other solutions.

    Check your module source roots.

    1. Project Structure (Ctrl+Alt+Shift+S).

    2. Modules

    3. Select your problem module.

    4. Change tab on top of window "Sources".

    5. Remove unwanted source roots. Keep one and add src and test source roots in this root.

提交回复
热议问题