The amount of free space on the hard drive needed by the build system is massive. The Android source code by itself can reach 100 gigabytes of occupied space. When we move to more advanced scenarios, such as building using a caching system, such as ccache, to speed up multiple system builds, we can easily reach 200 gigabytes of occupied space. It's very important to be sure that this kind of free space is available on your machine, because filling up the hard disk during the building process could bring the system into an unstable state.
Another note is about your connection speed—considering the amount of data needed to get ready to build, be sure to have a fast Internet connection, or an appropriate amount of patience.