58

While changing the values of a widget in properties tab, AndroidStudio keeps on throwing IndexNotReadyException. But after few minutes while retrying, the error is not occurring.

Here is the error log:

com.intellij.openapi.project.IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation
    at com.intellij.util.indexing.FileBasedIndexImpl.handleDumbMode(FileBasedIndexImpl.java:856)
    at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:805)
    at com.intellij.util.indexing.FileBasedIndexImpl.processExceptions(FileBasedIndexImpl.java:930)
    at com.intellij.util.indexing.FileBasedIndexImpl.collectFileIdsContainingAllKeys(FileBasedIndexImpl.java:1190)
    at com.intellij.util.indexing.FileBasedIndexImpl.processFilesContainingAllKeys(FileBasedIndexImpl.java:1018)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$26.compute(PsiSearchHelperImpl.java:1096)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$26.compute(PsiSearchHelperImpl.java:1093)

I've updated the AndroidStudio, to latest one. But still the error occurs. Any fix or work around?

Gokul Nath KP
  • 15,485
  • 24
  • 88
  • 126
  • What did the documentation the error points to say about it? – G_V Jan 28 '15 at 13:05
  • 1
    I am using android studio 1.3 stable version and still getting same errors as you are. I only tried to import my android project eclipse based. – Ahmed Aug 06 '15 at 01:47

5 Answers5

37

Happens because of the background indexing processes.

When the IDE is indexing, if we try to change the values in properties tab, then IndexNotReadyException is thrown.

Wait till indexing is complete.

Hope Google fixes this in AndroidStudio's next release!

Gokul Nath KP
  • 15,485
  • 24
  • 88
  • 126
29

File-> Invalidate Cache and Restart

This will stop the old indexing process and start a new one.

After that wait for indexing, and let that project build.

ankittie
  • 307
  • 3
  • 4
8

I faced the same problem and found solution according to this, I have changed the API level 22 to 21, problem solved.

API Level for XML layout was set **Automatically Pick Best ** which was API 22

enter image description here

And I change this API 22 to API 21:

enter image description here

and the exception removed.

Hope this help. Thanks

Community
  • 1
  • 1
Ramesh Kumar
  • 1,229
  • 14
  • 24
1

If you have tried opening the project built in esclipse from default Open Project option from Android Studio, try Importing the project and open it.

xerex09
  • 166
  • 14
0

when that happend, run gradle method, then incremental builds are rebuild and indexing is restarted:

task _deleteIncrementals << {
    def dirName = new File("${rootDir}/$project.name/build/intermediates/builds/debug/")
    dirName.deleteDir()
}
Sterling Archer
  • 22,070
  • 18
  • 81
  • 118