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

前端 未结 4 1938
执笔经年
执笔经年 2021-02-19 00:51

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?

相关标签:
4条回答
  • 2021-02-19 01:22

    I am learning android and I faced this issue today.

    Android was indexing forever because I added wrong image file. I deleted that image and it's working fine now, if you fall into this, I suggest that you to check all recent files that were added to your project and replace them with the correct ones.

    0 讨论(0)
  • 2021-02-19 01:30

    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.

    0 讨论(0)
  • 2021-02-19 01:37

    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.

    0 讨论(0)
  • 2021-02-19 01:45

    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.

    0 讨论(0)
提交回复
热议问题