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.
Photos: Salman Khan returns from Jodhpur to Mumbai
Pics: Sidharth Shukla-Rashami Desai's sizzling chemistry at TV show launch
Ooh La Lana! WWE Diva flaunts sexy curves in these 30 pictures
15 'peach' perfect photos of Priyanka Chopra at People's Choice Awards 2017
62 going on 16: These photos of Rekha prove she is 'forever young'