"He's not in good shape. He needs surgery," Bayern's sporting director Matthias Sammer told the club's website. "After the operation, we'll find out how long he's unavailable."
Bayern said that Gomez, who scored 26 Bundesliga goals last season and 28 the season before that, has been diagnosed with loose fragments of the joint in his right ankle which require surgical removal.
The striker played the first 42 minutes of Saturday's pre-season friendly against Werder Bremen, but was then substituted with ankle and calf problems.
David Alaba, with a stress fracture, Rafinha, with damaged ligaments, and Diego Contento, with a hairline fracture of the foot, are almost certain to miss the start of the season.
New signing Claudio Pizarro is also struggling with a long-term hip injury, while Franck Ribery has been forced to reduce his training workload in recent days with an inflammation of his heel.
The German season starts next Sunday with the Supercup match between Bayern and last season's double winners Borussia Dortmund. The first round of the German Cup follows one week later with the Bundesliga kicking off on August 24.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.