EXCLUSIVE: Adam Devine is set to co-write and star opposite Alexandra Daddario in When We First Met, a romantic comedy from director Ari Sandel (The DUFF). Footprint Features, MXN and Wonderland Sound and Vision will produce the pic, which Good Universe will launch at Cannes.

Devine stars as Noah, who spends the perfect first night with the girl of his dreams (Daddario) but gets relegated to the friend zone. He spends the next three years wondering what went wrong — until he gets the unexpected chance to travel back in time and alter that night, and his fate, over and over again.

Devine — who wrote When We First Met with John Whittington & Scotty Landes — stars on Workaholics, recurs on Modern Family and voices Pizza Steve on Uncle Grandpa. His big-screen credits include The Intern and the Pitch Perfect films, and next will be seen in Mike & Dave Need Wedding Dates. Repped by WME, Avalon and Morris Yorn, he also is set to topline New Line’s comedy Paternity Leave. Daddario starred in San Andreas and has appeared on True Detective, American Horror Story, Parenthood and White Collar. Her upcoming films include The Layover and Baywatch. She is with UTA and Untitled.

Adam Saunders of Footprint Features, Mason Novick of MXN and Mary Viola and McG of Wonderland Sound and Vision will produce. Devine, Michelle Knudsen, Steve Eddy and James McGough will exec produce. WME will handle domestic rights for the film.

Sandel is repped by WME and Principato Young, Whittington by Verve and MXN and Landes by CAA and attorney Lev Ginsburg.