The accusations against him date back to the 1990s, when they were at the center of a bitter child custody battle between Allen and his former partner, Mia Farrow. Allen’s affair with Soon-Yi Previn, who had been adopted by Farrow and would later marry Allen, also figured in the dispute, which split the family. In recent years, the journalist Ronan Farrow, a son of Mia Farrow and Allen, has come out in support of his mother and sister Dylan. Moses Farrow, a brother of Ronan, has sided with Allen.

As the #MeToo movement began placing a spotlight on the behavior of powerful men in Hollywood, the longstanding accusations received new life.

In December 2017, Dylan Farrow wrote an op-ed piece for The Los Angeles Times titled “Why has the #MeToo revolution spared Woody Allen?” Several Hollywood figures, including Greta Gerwig, Colin Firth and Peter Sarsgaard, have said they would not do another film with Allen.

Amazon already had a relationship with Allen dating back to 2016, when it distributed his film “Café Society,” starring Jesse Eisenberg and Kristen Stewart, followed by “Wonder Wheel,” featuring Justin Timberlake, the next year. According to the lawsuit, in August 2017, Amazon reached a deal with Allen’s production company to finance and distribute at least four films, including “A Rainy Day in New York,” which Allen completed. One of the movie’s stars, Timothée Chalamet, donated his salary from the film to charity.

The deal called for Allen’s company to be paid at least $68 million. Four months after the agreement was signed, the lawsuit said, Amazon executives met with Allen’s representatives to discuss delaying the release of “A Rainy Day in New York” to 2019, in part because of “negative publicity and reputational harm” Amazon was facing because of the studio’s past association with Harvey Weinstein. In the meantime, Allen began work on the other three films agreed to in the deal, the suit said.