A federal judge on Friday dismissed a lawsuit accusing Google Inc. of harming smartphone buyers by forcing handset makers that use its Android operating system to make the search engine company’s own applications the default option.

Consumers claimed that Google required companies such as Samsung Electronics Co. to favor Google apps such as YouTube on Android-powered phones, and restrict rival apps such as Microsoft Corp.’s Bing.

They said this illegally drove smartphone prices higher because rivals could not compete for the “prime screen real estate” that Google’s apps enjoyed.

But in Friday’s decision, U.S. District Judge Beth Labson Freeman in San Jose, California, said the consumers failed to show that higher prices stemmed from Google’s having illegally forced restrictive contracts.

She also said she could not tell how many supply chain levels there were between the handset makers who signed the alleged anticompetitive contracts, and the consumers themselves.

“Their alleged injuries — supracompetitive prices and threatened loss of innovation and consumer choice — are not the necessary means by which defendant is allegedly accomplishing its anticompetitive ends,” Freeman wrote.

The judge gave the plaintiffs three weeks to amend claims under the federal Sherman antitrust law and California’s unfair competition law.

Robert Lopez, a lawyer for the plaintiffs, did not immediately respond to requests for comment. Aaron Stein, a Google spokesman, declined to comment.

Google also faces antitrust issues in Europe.

The European Parliament in November urged antitrust authorities to break up the Mountain View, California-based company and called on the European Commission to consider proposals to unbundle search engines from other services.