Your anti-virus program might be impacting your build performance. Android Studio checked the following directories:
Asked Answered
E

2

6

Your anti-virus program might be impacting your build performance. Android Studio checked the following directories:

 C:\Users\user.name\.AndroidStudio3.5\system
 C:\Users\user.name\Documents\app-new-code  
 C:\Users\user.name\AppData\Local\Android\Sdk
 C:\Users\user.name\.gradle

Can anyone help me, how to get this disable this setting or increase the performance of android studio? I am using android studio version 3.5.

Electrotechnics answered 9/10, 2019 at 5:37 Comment(1)
which antivirus are you using? Also, note that excluding those folder from the antivirus scan could put your computer at risk because someone could store a virus in those directory knowing people might exclude themIlluminant
D
16

You should exclude this dir from antivirus in your machine.

  1. Open Windows Defender Security Center.
  2. Select Virus & threat protection > Virus & threat protection settings > Add or remove exclusions.
  3. Under Add an exclusion, select folder
Dispermous answered 9/10, 2019 at 6:45 Comment(2)
I didn't find any Add or remove exclusions option in Virus & threat protection .Juliettajuliette
@Juliettajuliette click on manage security under Virus & threat protection settings 1st. As I mentioned above, excluding a folder from your protection increases the risk of getting infected. You can exclude a process though from the protection, you might want to check out which option is the bestIlluminant
C
5

Cause

While Android Studio build process is in action, it create a lot of intermediate files in order to compile and package source code and resources. Enabling real time scanning in antivirus softwares will force it to scan all these newly created files for vulnerabilities. This is may interfere with the Android Studio build process, causing builds to run dramatically slower.


Fix

Exclude real-time scanning on these directories.

Gradle cache
%USERPROFILE%\.gradle

Android Studio projects
%USERPROFILE%\AndroidStudioProjects

Android SDK
%USERPROFILE%\AppData\Local\Android\SDK

Android Studio system files
C:\Program Files\Android\Android Studio\system

This is how you can accomplish the same in different antivirus softwares.
Windows Defender
Kaspersky
AVG Antivirus

Note: You can also disable the disable real-time scanning completely. This method isn't recommenced since it will open security risks.

Crescen answered 21/10, 2019 at 20:17 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.