Intellij无法在导入时解析符号 [英] Intellij Cannot resolve symbol on import

查看:464
本文介绍了Intellij无法在导入时解析符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于不同的库和不同的项目,此问题会间歇性地发生。
尝试导入库时,将识别包,但无法解析类名。

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't be resolved.

如果在import语句中,我右键单击 - >转到 - >包的声明,我看到侧窗格中显示的所有反编译类 - 包括我需要的 -
如果我尝试自动完成import语句,我会注意到类我需要的不是下拉列表中的特色。

If on the import statement, I right-click -> Goto -> the package's declaration, I see all the decompiled classes displayed in the side pane -- Including the ones I need -- If I try to auto-complete the import statement, I notice the class I need is not featured in the dropdown.

我尝试使缓存无效,不起作用。我找不到任何类冲突 - 我的类路径中没有其他jar文件具有相同的包名称。
我可以将这个类导入其他项目。

I tried invalidating caches already, doesn't work. I cannot find any class conflicts -- there is no other jar file in my classpath with the same package name. I am able to import this class into other projects.

请看屏幕截图:

任何人都有线索?

推荐答案

你可以尝试使缓存失效并重新启动intellij,在很多情况下它会有所帮助。

you can try invalidating the cache and restarting intellij, in many cases it will help.

文件 - >使高速缓存无效/重新启动

File -> Invalidate Caches/Restart

这篇关于Intellij无法在导入时解析符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆