How can I stop Android Studio Indexing/Scanning/Building altogether at startup?

19,145

Solution 1

You can't stop or defer this process. The process is required for the IDE to build a model of your code, which is required for all features that make a difference between the IDE and a text editor (code navigation, code completion, error highlighting, usages search, refactoring and so on).

If you do not need any of those features, you can avoid this process altogether by using a text editor such as Sublime Text instead of Android Studio.

Solution 2

I solved it by just Invalidate and Restart. I experienced this isssue in a loop, indexing non stop without Run or Build anything.

File --> Invalidate Cache/Restart.

Solution 3

You can actually cancel the build on start. I find this build to be pointless for a variety of reasons:

  • most devs would start the program then connect the phone/open the emulator first
  • even though the builds the app this doesn't mean much because when you click build again it starts over...

The way to cancel the build is just simply click on the little red x at the task at the bottom.

When you ready to build then you can just click on run again.

I consider this a bug because it's indeed pointless since it does not make consequent builds any faster nor it is required for the IDE to work unlike what the accepted answer suggests.

However mind that this does not the same as "Indexing" which is Android Studio indeed need. However on a normal startup case you can just cancel the build.

I have an open request for this at Google, we will see if they actually do something with it in the future since I don't see the point of wasting sometimes minutes for a initial build I cannot even use later.

Share:
19,145

Related videos on Youtube

Neon Warge
Author by

Neon Warge

#SOreadytohelp

Updated on September 28, 2022

Comments

  • Neon Warge
    Neon Warge over 1 year

    How can I stop this indexing or whatever this startup process? What is it for? Why is it doing it? Can I defer the loading of such huge process later on when I most need it?

    • CommonsWare
      CommonsWare about 8 years
      I only notice an "indexing" step when creating or importing a project. Opening an existing project skips most of that. Creating and importing projects are infrequent tasks for most developers.
    • Siddharth
      Siddharth about 6 years
      @CommonsWare seems like you are the only one with such an amazing experience. Everyone else faces what is explained in this question.
  • Neon Warge
    Neon Warge over 6 years
    Thanks, actually I am running Android studio on a much older hardware and its pre 2.3.3 where everything seems to very slow and eats up 100% CPU for some reason with only AS running. Past 2.3.3 everything seems to be stable now but yeah the building on program start and everything it does at startup is pretty much annoying. I build if I wanted it to be put on phone but Google knows better than me so for some reason.
  • Neon Warge
    Neon Warge almost 6 years
    Thanks! But I posted this back pre 2.3.3 (version where I found AS perf to be very stable even on slow pcs), right now since version 3.0 everything is buttery smooth. .
  • Abdul Wadood
    Abdul Wadood almost 6 years
    This magically stopped indexing again and again after every second. Thanks! Maybe you add how to Invalidate and Restart that might help some newcomers.
  • Infinite Loops
    Infinite Loops almost 6 years
    @AbdulWadood the answer already edited. Hope you can upvote to make it visible to more people.
  • vesperto
    vesperto about 3 years
    You can't cancel indexing, there's no X to click on. Wish there was.