The 33-year-old Scottish actor was billed to star alongside Benedict Cumberbatch, who has been cast as Wikileaks founder Julian Assange in the film.
But filming commitment on the next X-Men project, "Days of Future Past", has forced McAvoy to walk away from the film, the Hollywood Reporter said.
McAvoy's role has already been filled by "Inglourious Basterds" star Daniel Bruhl. Bruhl will now portray Daniel Domscheit-Berg, the author of the book Inside WikiLeaks: My Time with Julian Assange at the World's Most Dangerous Website. Meanwhile, Laura Linney is reportedly in talks to join the cast.