Archive::build() must have the same parameters order as all the API calls that use idSite, Period, Date.
Attachment: patch for Archives.php
fixed in 
the only thing is that in your patch you're using an absolute path D:/project/piwik etc. it makes it impossible to apply your patch directly. you should instead have a relative path /modules/Archive.php etc.