Medvedev, who lost a thrilling five-set final to Andre Agassi at Roland Garros in June, was trailing 7-5, 1-0 to Christian Ruud of Norway when he pulled out.
The Ukrainian, who was competing for the first time since Wimbledon, had not played on clay since his inspired show in Paris.
Medvedev, the 1992 champion at the hill-top Weissenhof club, had first been troubled by the right ankle problem during a doubles match on Monday, but a doctor told him it would be safe to try to play in the singles event.
Ruud, ranked No 54 in the world, moved through to a second-round match against his fellow Scandinavian Thomas Johansson, the No 9 seed and the world No 20 from Sweden.
Marat Safin, who last weekend helped Russia win their Davis Cup quarter- final tie against Slovakia, could not sustain the form as he was beaten by Mariano Puerta of Argentina 6-3, 6-4. Puerta will next face the No 7 seed, Tommy Haas of Germany, who had a first-round bye.Reuse content