We introduce a cochain complex for ample groupoids \(\mathcal {G}\) using a flat resolution defining their homology with coefficients in \(\mathbb Z\) . We prove that the cohomology of this cochain complex with values in a \(\mathcal {G}\) -module M coincides with the previously introduced continuous cocycle cohomology of \(\mathcal {G}\) . In particular, this groupoid cohomology is invariant under Morita equivalence. We derive an exact sequence for the cohomology of skew products by a \(\mathbb {Z}\) -valued cocycle. We indicate how to compute the cohomology with coefficients in a \(\mathcal {G}\) -module M for AF-groupoids and for certain action groupoids.