We develop a rigorous topological theory of anomalies on the lattice, which are obstructions to gauging global symmetries and the existence of trivial symmetric states. We also construct I^c◯-spectra of a class of invertible states and quantum cellular automata, which allows us to classify both anomalies and symmetry protected topological phases up to blend equivalence.