Reputation: 99
Sometimes Android stusio warns me with the following warning: "Your anti-virus program might be impacting your build performance. Android Studio checked the following directories":
C:\Users\user.name\.AndroidStudio\system
C:\Users\user.name\Documents\app
C:\Users\user.name\AppData\Local\Android\Sdk
C:\Users\user.name\AppData\Local\Google\AndroidStudio
C:\Users\user.name\.gradle
I would like to know if it is okay to ignore this warning as I would want to not exclude any directories for my antivirus. Could I have any issue if I have sometimes this warning in my app builds and I don´t exclude thos directories so I will still be warned? Could my app stop working fine or something like that or it doesn´t matter to have that warning? I would like to know if it is recommended to solve this warning for my app health...
Upvotes: 1
Views: 524
Reputation: 19554
Here's the official documentation about it: Optimize Android Studio performance on Windows
The short version is no, you don't have to exclude anything if you don't want. The issue is that real-time scanning can slow down your builds, because it involves generating a lot of files that the antivirus wants to check over. So the build process keeps stopping while that happens. Depending on your machine, the sources that need to be built, the build config and its cached state, this could create a lot of slowdown.
They're "recommending" disabling antivirus because the implication is those files are safe, but the AV has no way of knowing that. It's up to you whether you trust that "recommendation" - air-quotes because they never actually say you should do it, just that you can, including the "heyyyyyy just sayin' if you excluded a few folders..." popups.
What you could do, is try excluding those folders and comparing builds - you'd have to invalidate your caches each time to get a fair comparison (rebuilding can be quick when some stuff doesn't need to be redone) and see if it makes a difference to you, and if you think it's worth it. Maybe try it with a release build (since those are a lot slower). Work out how much time it saves, how often you build during a day, and if it's a significant total. That kind of thing!
Upvotes: 2