Judge Steven O’Neill rejected arguments made by lawyers for Cosby which claimed prosecutors had violated the comedian’s rights by refusing to call his accuser as a witness at a preliminary hearing in May.
After a three-hour hearing in Montgomery County Court of Common Pleas, Judge O’Neill refused to schedule a new preliminary hearing in the case.
Once one of the best-known US entertainers thanks to shows including The Cosby Show and Fat Albert And The Cosby Kids, Cosby is facing accusations of sexual assault from dozens of women dating back decades.
The case in Pennsylvania is the only criminal prosecution against him as most of the other allegations involve alleged incidents that are too old to prosecute.
Cosby is accused of drugging and sexually assaulting Andrea Constand at his home near Philadelphia in 2004.
Authorities reopened the case last year after learning he had acknowledged in a deposition that he had given the woman pills and then engaged in sex acts with her.
He denies the charges and claims the alleged encounter was consensual.
Brian McMonagle, a lawyer for Cosby, said after the ruling: “Today someone who has given so much to so many had his constitutional rights trampled once again.”
Lawyers for Cosby had said they needed to cross-examine Ms Constand before a trial over the statement she made to police.