Android Studio: background task runs unlimited time

After updating the Android SDK, I launched Android Studio. Now its display of the background task is continuously performed with the message

Index update: scan files for indexing.

In this mode, he almost hanged himself, and I canโ€™t work on him. Could not find a way to stop the background task. Rebooting Android Studio also did not work.

+65
android android-studio
Jul 24 '13 at 13:02
source share
7 answers

I found out that I should use the @ free3dom solution, which is the Invalidate Caches / Restart option in the File menu.

I have to do this every time I change any project file by switching branches to GIT.

And yes, Android Studio really sucks and is full of bugs ...

+70
Jul 19 '15 at 20:55
source share

Disconnect all phones and reconnect them, it will work. This is due to adb, as indicated here: https://code.google.com/p/android/issues/detail?id=172387 and a known bug that needs to be fixed in the future

+27
Aug 08 '15 at 22:31
source share

Indexing is triggered through inotify on Linux.
There is a limit to the number of directories that one user can set on a watch. If your project is large, then this limit can be exceeded, and Android Studio returns to the recursive scan mode, which is very slow.

To fix this, add this line to /etc/sysctl.conf file :

 # Increase the limit for Android Studio `fs.inotify.max_user_watches = 500000` 

Then run sudo sysctl -p .

+3
Jun. 19 '15 at 0:01
source share

I have this problem recently, and in my case I use Linux 64-bit SO, and my android studio was on ntfs disk. Since ntfs does not support executable resolution, the fsnotifier64 file could not be executed, and the android-studio reserve in compatibility mode is much slower. The solution was to copy the android-studio folder to my home folder, which was ext4, and so I was able to set permissions.

0
Oct 27 '13 at 21:59 on
source share

I struggled with this problem for almost one hour, and after that I discovered that this is a problem with the adb connection, you can disconnect the device once and stop all adb workflows. This problem can be solved.

0
Jun 09 '18 at 18:17
source share

This happened in my project every time I added a new activity. So I included my R file in this class, and it stopped.

for example: import com.domain.appname.R;

This solved the problem.

0
09 Oct '18 at 16:39
source share

I also run into this problem, I tried almost all the methods mentioned in this post, but none of them worked. The only solution that worked for me was to upgrade Android Studio to version 3.5 (which at the time of writing this answer was still a test version).

0
Feb 01 '19 at 12:54 on
source share



All Articles