PSI and index do not match: PSI and index do not match on Android Studio

邮差的信 提交于 2019-11-28 18:03:07

问题


Whenever I clean my project is says: PSI and index do not match What should I do?


回答1:


Important note: This will wipe the shelf, local history, and potentially other cached data.

File menu > Invalidate caches and restart. The PSI cache is one of the caches that are affected by this command, so this should fix it up.




回答2:


Whenever I navigated to a class, I'd get this PSI error. Clicking the details in Android Studio, it included the following:

viewProvider=SingleRootFileViewProvider{myVirtualFile=jar://<user-directory>/.gradle/caches/modules-2/files-2.1/com.squareup.haha/haha/2.0.3/e0672395ac43377f2510b14839342a24fdf35c18/haha-2.0.3-sources.jar!/com/squareup/haha/guava/io/GwtWorkarounds.java, content=VirtualFileContent{size=5678}}

Based on this info, I tried deleting <user-directory>/.gradle/caches/modules-2 and restarting Android Studio and it seemed to fix the PSI error, and it didn't seem to delete local history (though I don't know if anything else important was deleted).




回答3:


Invalidating caches didn't work for me. Only a complete re-install of AS and all relevant SDK, Gradle etc... did the trick. I started by uninstalling AS. Then I manually deleted the SDK folder. I also deleted the .gradle and .android folders in my C:/Users/[my.user]/ folder.




回答4:


Android Studio (windows) File -> Invalidate Caches/Restart...

then click on (Invalidate and Restart) button




回答5:


I have also faced this problem. I have solved this by going to File menu > Invalidate caches and restart.



来源:https://stackoverflow.com/questions/28794723/psi-and-index-do-not-match-psi-and-index-do-not-match-on-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!