Files under the build folder are generated and should not be edited, cannot re-build android project

This is because you are trying to modify the wrong version of AndroidManifest. Android Studio shows you the file located in the build folder when it finds errors. Open app/src/main/AndroidManifest.xml and modify it.


I had encounter this when I putted 0 value in the screenOrientation attribute and it solved just after I deleted the file in the path

...path_to_modoule\app\build\intermediates\manifests\full\debug.AndroidManifest.xml

Just remove the affected code and clean the project one or two times and restart Android Studio. It works for me.