In summers past, Hollywood used to give audiences a break from all the action-packed sequels targeted to teenage boys. Usually, that came in the form of counterprogramming known as the romantic comedy. For most of the late ’90s, Julia Roberts carried the genre: she opened 1997’s “My Best Friend’s Wedding,” which grossed nearly $300 million worldwide, against the disastrous “Batman and Robin.” She was also the star of such summertime hits as 1999’s “Notting Hill” ($364 million worldwide), “Runaway Bride” ($309 million) and 2001’s “America’s Sweethearts” ($138 million), which marked the end of her reign as the queen of romantic comedies.

One of the reasons that the summer of 2014 has been so catastrophic, with box office grosses down 18 percent, is the glut of indistinguishable product. Every movie, from “Transformers 4” to “The Amazing Spider-Man 2,” feels like a photocopy of something that came before it. But the biggest profit margins aren’t always tied to CGI or comic book stories. For proof, look no further than the weepy melodrama “The Fault in Our Stars,” which has so far grossed $263 million worldwide despite its tiny budget of $12 million.

While not similar in tone to a Julia Roberts movie, it followed the same business model. The romantic comedy used to appeal to studio executives because they were relatively cheap to make and easy to sell. That was the thinking two decades ago, but Hollywood has all but forgotten how to tailor material to women, who make up about 51 percent of all tickets sold at the multiplexes. The two breakout comedies of this summer, “22 Jump Street” and “Neighbors,” were bromances, the genre that murdered the romantic comedy. These movies still feature women, but they are really about the relationships between straight men.

The romantic comedy started to fade around the same time as Judd Apatow’s first hit, 2005’s “The 40-Year-Old Virgin” and continued to disappear with the emergence of other summer tentpoles directed by him (like 2007’s “Knocked Up”), produced by him (like 2007’s “Superbad” or 2008’s “Pineapple Express”) or inspired by his comedic sensibilities (like 2009’s “Hangover”). As all this was happening, the actresses who used to rule the genre — Julia Roberts, Sandra Bullock, Renee Zellweger and Cameron Diaz — started to enter their forties, where they aged out of playing lovesick heroines. The starlets who followed them — Katherine Heigl, Kate Hudson and Rachel McAdams – weren’t able to give the romantic comedy the same irresistible zip.

But the genre might not be broken beyond repair. “I believe that genres are only dead until they are not,” said Terry Press, the president of CBS Films, which is releasing “What If,” one of the only high-profile romantic comedies of the summer. The story about a medical student (Daniel Radcliffe) who falls for a animator (Zoe Kazan) feels like a throwback to Nora Ephron — “Sleepless in Seattle” set in Toronto. It’s also something that doesn’t come along very often: a romantic comedy aimed at millennials. The budget for “What If” was only about $11 million, meaning it doesn’t need to sell as many tickets to turn a profit.

Daniel Radcliffe, who has been trying to distance himself from the decade he spent as Harry Potter, says he was drawn to the more traditional elements of the story. “There’s nothing revolutionary about it,” Radcliffe says. “It’s just done really well. And I think we avoid some of the cliches of romantic comedies.” He liked the script from the second page. “This whole interchange about mispronouncing the word forte,” Radcliffe recalls. “I was like, ‘that really reminds me of me.’ I’m really into the etymology of words.”

Richard Curtis, the writer of “Four Weddings and a Funeral,” “Love Actually” and “Notting Hill,” told Variety last fall that he’s often at a loss to explain what happened to the niche he helped create. “I would say maybe this formulaic genre just had a little flare up, between 1995 and 2010,” Curtis said. “When I wrote ‘Four Weddings and a Funeral, I didn’t know it was a romantic comedy.” Curtis, who has decided to retire from filmmaking, can’t successfully launch a romantic comedy anymore. His latest, “About Time,” which opened last October, grossed a disappointing $15 million in the United States.

That’s not to say that another director couldn’t envision a way to reboot romantic comedies. And as much as Hollywood loves reboots, it’s actually a good time for reinvention. After this summer’s sluggish ticket sales, studios will be second-guessing how they do business. There were two recent signs that the industry is finally waking up to the importance of projects headlined by women. Sony Pictures is considering a female-centered “Ghostbusters” and a female-driven superhero movie from the “Spider-Man” universe. But along with those announcements, the romantic comedy also deserves a second chance.