I had the same problem and i did a clean start of the guide once again in a different location in my drive and also i use the github app instead of Git app and it worked for me like a charm.
How I understand:
For APM the you should check out 3.2.1.
you can download it from github.
then following the wiki page to download the arduino IDE(special version) and you can build the firmware without any problem.