'Android Studio build keeps crashing (stableIds.txt The data is invalid. (13))
I've been trying to run my android studio app but android studio keeps giving me this build error for all of my projects.
Full error is this:
ERROR:: AAPT: <App Location>\app\build\intermediates\stable_resource_ids_file\debug\stableIds.txt: error: failed to open: The data is invalid. (13).
I tried making fresh projects too but that didn't seem to fix it. I didn't change anything in those projects. I also checked and there is no stableIds.txt. This issue didn't happen before too so I'm even more confused.
Solution 1:[1]
I was experiencing the same issue... my anti virus program (AVG) was the culprit. AVG was silently preventing Android Studio from working properly...despite having already turned off AVG's File Sheild, and Behaviour Sheild. I fixed this by:
solution 1
- turning off AVG's
Ransomeware Protectionshould also prevent this from ever happening again.- (may also need to turn off
File SheildandBehaviour Sheildbut I'm not sure, because I already had them turned off before this happened) - i just looked at some of my AVG's settings for the first time....so much time wasted over the years....
- (may also need to turn off
solution 2
- restarting my computer (only worked for me after i restarted for 2nd time)
- open the project in android studio
- try to deploy the app onto a device
- wait for a popup from AVG to appear, asking if you want to prevent
aapt2.exefrom modifyingstableIds.txt - allow it..
- build the app without any issues!
Solution 2:[2]
This Problem occurs when Ransomware Protection > Controlled Folder Access is turned on in Windows Defender. To fix it, Go to Windows Defender > Ransomware Protection and Turn Off Controlled Folder Access. If You have a different antivirus, they may also have similar settings which might prevent Android Studio from functioning normally.
This fix worked in my case...
Solution 3:[3]
Most Likely an Anti-Virus problem
Temporarily disabling the anti-virus program for a few minutes solved this problem for me.
- Close Project in Android Studio (File > Close Project)
- Disable Anti-Virus.
- Re-open the project and run the app.
Solution 4:[4]
The Problem With Gradle version enter gradle.build and change gradle to previous version. enter image description here
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Jeswin Joji |
| Solution 3 | Simon1GA |
| Solution 4 | Ahmed Godaa |
