javaandroidcrashaapt

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

  • 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

    1. turning off AVG's Ransomeware Protection should also prevent this from ever happening again.

    solution 2

    1. restarting my computer (only worked for me after i restarted for 2nd time)
    2. open the project in android studio
    3. try to deploy the app onto a device
    4. wait for a popup from AVG to appear, asking if you want to prevent aapt2.exe from modifying stableIds.txt
    5. allow it..
    6. build the app without any issues!