I had the same problem, here is what fixed it for me:
- close the project in intellij.
- close intellij.
- go to the project folder and delete the
.idea
folder - restart intellij and open the project (wait for the indexing to finish) and it would work.
简单说就是退出项目,删除.idea文件夹,重新导入项目就会自动重新加载项目,然后问题神奇的解决了。。
参考了
https://stackoverflow.com/questions/27470926/intellij-say-cannot-find-declaration-to-go-to-in-android-xml-file