Four suspects of a crime made the following statements to the police:

Andy: Carl did it
Bob: I did not do it.
Carl: Dave did it.
Dave: Carl lied when he said I did it.

Given that exactly one of them "did it" and that exactly one told the truth. Who did it?