Exporting for android failed with error.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By toivocat

I was exporting my first mobile game I got an error. Then another. The first one was that I didn’t have java 11 installed so I installed it. Then the next one… it said this:

Execution failed for task ‘:processDebugResources’.

A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
Android resource linking failed
ERROR:AAPT: error: failed writing to ‘C:\Users\MyUser\Desktop\Godot Programs\Projects\MobileGame\android\build\build\intermediates\runtime_symbol_list\debug\R.txt’: The data is invalid. (13).

Which makes no sense at all to me.
I really need help.

:bust_in_silhouette: Reply From: jgodfrey

Could be that your AntiVirus software is blocking the creation of R.txt. If possible, add an exception to your AV app for the folder structure in question or temporarily disable the AV while building.

This worked for me.

toivocat | 2022-05-14 22:12

:bust_in_silhouette: Reply From: Gluon

Try upgrading your gradle version, if you go to preferences->Build, execution, delpoyment → Gradle

in this section you will see the gradle version and the path to the location of gradle in your system. If you update this it may solve your issue.