From BBC News:
David Cecil says he is delighted by the ruling
Mr Cecil told the BBC the case was dismissed either because of a “lack of will or a lack of evidence” to try him.
He was arrested in September for “disobeying lawful orders”, because the play The River and the Mountain was performed without authorisation.
Homosexual acts are illegal in socially conservative Uganda.
The Ugandan parliament is considering legislation aimed at increasing penalties for homosexual acts.
Mr Cecil faced up to two years in jail if convicted.
He was freed on bail of 500,000 shillings ($200; £124).
Mr Cecil told the BBC he was delighted by the magistrate’s decision to dismiss the case, although it could be reopened.
“Today’s [Wednesday’s] outcome demonstrates there is a functioning judiciary in Uganda and it has restored my faith in Ugandan society,” Mr Cecil said.
The prosecution told the magistrate that police had not yet given them a case file, he said.
“This indicates the investigation has either stalled or they don’t have enough evidence,” Mr Cecil added.
The play, which tells the story of a gay businessman killed by his own employees, was performed at two theatres in the Ugandan capital, Kampala, in August.
Uganda’s Daily Monitor newspaper reported at the time that the Media Council had warned the play’s backers not to perform it until it had been approved.
Mr Cecil told the BBC he would not stage the play again, because cuts ordered by the Media Council would “disembowel” the production, he said.
Gay people have faced physical attacks and social rejection in Uganda.
In 2011, activist David Kato was beaten to death but police denied this was related to his sexuality.
Last month, Uganda’s parliament debated a bill to increase sentences for people convicted of homosexuality.
The original version of the bill stipulated the death penalty for some homosexual acts but this has reportedly been dropped in favour of a life sentence.
Ugandan President Yoweri Museveni last month said gay people should not be killed or persecuted, but he also stressed homosexuality should not be promoted either.
The bill was first introduced in 2009, sparking an international outcry.
US President Barack Obama described it as “odious”.