The judge in the Tulisa Contostavlos trial said evidence given by undercover reporter Mazher Mahmood was "entirely inconsistent".
Explaining his decision to throw out the trial, Alistair McCreath said the prosecution's case had become "tainted" by "serious misconduct".
Before the start of the trial, Contostavlos' lawyers had attempted to have the prosecution "stayed", meaning it would have been thrown out before beginning.
The court hear that there was a problem with evidence provided by a driver called Alan Smith, who originally said he had heart Contostavlos speaking disapprovingly about drugs when she was in his car.
He then "changed his mind", after a conversation with Mahmood, the court was told.
At a pre-trial hearing, Mahmood denied having had any conversation with Mr Smith about what Contostavlos had said.
But the judge said when asked about the same topic during the trial, Mahmood gave answers that were "entirely inconsistent".
More top news
An explorer in the Seychelles was chased down by a wild animal after disturbing a mating session... in potentially the slowest chase ever.
As if proving they can stand the heat, David Cameron, George Osborne and Nick Clegg all headed to the kitchen today.
The winds will remain strong tonight and in the north showers will continue, which may turn wintry over high ground.