user971741
user971741

Reputation:

Android Studio not starting: Fatal error initializing 'com.intellij.util.indexing.FileBasedIndex

I just installed Android Studio, and now when I am starting it is giving me this error. How can I resolve it?

 Internal error. Please report to http://code.google.com/p/android/issues

java.lang.RuntimeException: com.intellij.ide.plugins.PluginManager$StartupAbortedException: Fatal error initializing 'com.intellij.util.indexing.FileBasedIndex'
    at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:159)
    at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:46)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744)
    at java.awt.EventQueue.access$400(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:697)
    at java.awt.EventQueue$3.run(EventQueue.java:691)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:714)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:697)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: com.intellij.ide.plugins.PluginManager$StartupAbortedException: Fatal error initializing 'com.intellij.util.indexing.FileBasedIndex'
    at com.intellij.ide.plugins.PluginManager.handleComponentError(PluginManager.java:244)
    at com.intellij.openapi.components.impl.PlatformComponentManagerImpl.handleInitComponentError(PlatformComponentManagerImpl.java:39)
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:570)
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:590)
    at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:225)
    at com.intellij.util.pico.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:212)
    at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:199)
    at org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer.getComponentInstance(AbstractDelegatingMutablePicoContainer.java:75)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponent(ComponentManagerImpl.java:121)
    at com.intellij.openapi.application.impl.ApplicationImpl.createComponent(ApplicationImpl.java:371)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:112)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:89)
    at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl.load(ApplicationStoreImpl.java:87)
    at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:508)
    at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:151)
    ... 18 more
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: C:\Users\UserName\.AndroidStudio\system\index\todoindex\TodoIndex.ver (The system cannot find the path specified)
    at com.intellij.util.indexing.FileBasedIndexImpl.initExtensions(FileBasedIndexImpl.java:332)
    at com.intellij.util.indexing.FileBasedIndexImpl.initComponent(FileBasedIndexImpl.java:359)
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:548)
    ... 30 more
Caused by: java.io.FileNotFoundException: C:\Users\UserName\.AndroidStudio\system\index\todoindex\TodoIndex.ver (The system cannot find the path specified)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
    at com.intellij.util.indexing.IndexInfrastructure$1.execute(IndexInfrastructure.java:95)
    at com.intellij.util.indexing.IndexInfrastructure$1.execute(IndexInfrastructure.java:90)
    at com.intellij.openapi.util.io.FileUtilRt.doIOOperation(FileUtilRt.java:517)
    at com.intellij.util.indexing.IndexInfrastructure.rewriteVersion(IndexInfrastructure.java:90)
    at com.intellij.util.indexing.FileBasedIndexImpl.registerIndexer(FileBasedIndexImpl.java:390)
    at com.intellij.util.indexing.FileBasedIndexImpl.initExtensions(FileBasedIndexImpl.java:290)
    ... 32 more

Upvotes: 22

Views: 39676

Answers (21)

MrOnyancha
MrOnyancha

Reputation: 606

This works without the loss any settings or project. It will take you to your previous state at the time of editing an open file.

  1. Go to your home directory. ie /home/XXXXXX/.AndroidStudio.X.X
  2. Rename the .AndroidStudio.X.X to any thing else i.e. back_up/
  3. Run your android studio
  4. It will prompt you to import current setting or create a new version
  5. Choose the import setting and select the back_up/ directory

Bravo you are good to go.

Upvotes: 24

almosaabi Mosaabi
almosaabi Mosaabi

Reputation: 1

just delete the folder "marketplace"

located : C:\Users\usename.AndroidStudio4.0\config\plugins

regards

Upvotes: 0

Ali Arslan Ansari
Ali Arslan Ansari

Reputation: 58

Do the followings

  1. Restart your computer
  2. Delete the .AndroidStudio.X.X folder from %USERPROFILE%.
  3. Set the Environment Variable ANDROID_HOME = C:\Users\Pc\AppData\Local\Android\Sdk\ ANDROID_SDK_HOME = C:\Users\Pc\AppData\Local\Android\Sdk\
  4. Restart Your Computer >> Start Android Studio >> Choose "Do Not Import Settings" And Here you Go....Enjoy, Happy Learning!

Upvotes: 1

It's the IRIS plugging which is disabled.(for MACOS) If you go on the android studio starter window, you go on configure Menu ~> plugins ~>installed ~> Iris

And you switch disable to enable

Worked for me , on the contrary of restarting computer or removing Lib/Caches/...

Upvotes: 1

Mohsen Mousavi
Mohsen Mousavi

Reputation: 173

In my case it was the low memory error on Android studio, just enlarge it and you're good to go.

Upvotes: 0

abhiTronix
abhiTronix

Reputation: 1422

The Easiest solution that works for the latest Android Studio:

  1. Check the latest Plugin [check by date and time] installed in Android Studio C:\Users\{Username}\.AndroidStudio\config\plugins directory. {Mostly Third-party Plugin is the cause}
  2. Go Forward Delete that plugin [.jar file]. - no need to delete/rename the whole directory as suggested by others.
  3. Close Android Studio properly - through Task Manager or through Restarting your Computer.

Problem solved !!! Cheers.

Upvotes: 18

Mehran Mahmoudkhani
Mehran Mahmoudkhani

Reputation: 456

do the following steps :
1. Delete your Old System Environment Variables(e.g JAVA_HOME,GRADLE_HOME,ANDROID_HOME or ...)
2. Restart your pc
3. Set Environment Variables Again
4. Lunch Android Studio

Upvotes: 2

GeorgeChen
GeorgeChen

Reputation: 333

You can uninstall plugin directly from Android Studio launcher.
Configuration -> plugins -> uninstall the error component.

Upvotes: 0

Nikhil Goswami
Nikhil Goswami

Reputation: 81

install jdk 8 different version will give error

Upvotes: 0

Alexandra Axt
Alexandra Axt

Reputation: 1346

For me, without reinstalling anything: The problem was caused by a new plugin. In users/.../config/plugins I removed the plugin file and its entry from extensions.xml. Then my IDE started working again.

Upvotes: 0

Jack
Jack

Reputation: 1855

This might be the problem caused by a newly added plugin . so remove it by following Fordo Alexandera's answer.It worked for me

Upvotes: 0

Fordo Alexandera
Fordo Alexandera

Reputation: 51

Solved this problem.

For me, all above methods are useless.

Then I guess maybe the plugin installed newly cause the error .

I empty the plugins at the directory of C:\Users\...\.AndroidStudio\config\plugins and it work normally.

Upvotes: 3

Maskim
Maskim

Reputation: 412

As I can't comment MrOnyancha's answer, I write an "new" answer (not enough reputation) :

I solved my problem by simply remove C:\Users\{my_name}\.AndroidStudioX.X as his solution didn't work for me.
At the next start of Android Studio, I had the installation wizard but any SDK had to be downloaded, might be done offline...

Upvotes: 0

Kushal Kumar
Kushal Kumar

Reputation: 11

Just go to ~\system\caches make backup of caches delete all the files in caches folder

Restart Android Studio and it will work like butter.

Tried it on Windows.

Upvotes: 0

agilob
agilob

Reputation: 6243

As of 15/01/2018 Intellij doesn't start with Java9 and throws this error. Set JAVA_HOME to java8.

Upvotes: 0

Shambhu
Shambhu

Reputation: 191

For me,

I just uninstalled the Android Studio and again reinstalled.

And then some dependencies had to add.

Then it work like a charm

Upvotes: 0

Edison Q
Edison Q

Reputation: 79

For me under Windows 7 Environment, this solution worked:

In order to fix this issue, please ensure your JAVA_HOME is pointing to C:\Program Files\Java\jdk1.8.0_102 (Java SE Development Kit) instead of C:\Program Files\Java\jre1.8.0_102 (Java SE Runtime Environment). In fact, JRE is located inside JDK folder.

If you haven't installed JDK yet, please do it following next link: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html?ssSourceSiteId=otnes

Quote my source: https://code.google.com/p/android/issues/detail?id=211766#c8

Upvotes: 0

Paul
Paul

Reputation: 181

I just encountered this after the upgrade to 2.2 (on Windows 7 Pro). I tried all of the solutions above, and combinations, including going back to an earlier config (.AndroidStudio2.1 and .AndroidStudio2.0 in my Users directory) and specifying no earlier config to import. Nothing fixed it. So here's what did: I reinstalled Android Studio from a fresh download. I let it de-install the previous install, but did NOT let it reinstall the SDK, pointing it to the existing SDK install instead (I did NOT want to redownload the various system images I use on my slowish internet). That fixed the problem.

Upvotes: 0

Kayvan N
Kayvan N

Reputation: 8406

I had the same problem and the error comes from Cache folder so I removed all the Android Studio related folders in this path: ~/Library/Caches/ and also as Eng Chrisp mentioned all the old settings from ~/.AndroidStudioXXX. Make sure you export all your settings before deleting these directories. You can do so by using Export Settings option in File menu of Android Studio.

Upvotes: 0

Korhan &#214;zbek
Korhan &#214;zbek

Reputation: 83

i have same problem. and then i research the problem. i founded a solution which working for me. i changed the system language in macO

Upvotes: 0

Willis
Willis

Reputation: 5336

There was a similar issue posted on Androids open source bug tracker: https://code.google.com/p/android/issues/detail?id=74458

The solution was to restart your computer. Try this and see if it works.

Upvotes: 5

Related Questions