By Steve Keating
Nishikori, seeded 20th, had reached the last four after registering a pair of spectacular three-set upsets, defeating Spain's David Ferrer in the fourth round followed by a quarter-final win over Swiss 17-times grand slam winner Roger Federer.
The disappointing withdrawal ended a remarkable Miami run by the 24-year-old Nishikori, who knocked off three top 15 seeds, number 15 Grigor Dimitrov, number five Federer and number four Ferrer to get to the semi-finals.
"It's really sad, of course, semi-final in a big tournament," Nishikori told reporters. "Was really playing well and beating Dimitrov, David and Roger. I was really excited to play here the semis.
"But unfortunately I couldn't move side-to-side. Just tried to warm up today, but I couldn't move."
Nishikori said that the groin had been bothering him for sometime but flared up during his match against Federer that ran late into an unusually cool evening in South Florida.
The Japanese number one also retired during the Delray Beach tournament in February for similar reasons.
"I really felt (it) the last match against Roger, the quarter-final," said Nishikori. "I had it before Indian Wells, and I hurt it in Delray. It wasn't 100 percent yet."
Nishikori will return to Japan where he will see doctors to determine the extent of the injury that could keep him out of Japan's Davis Cup tie next month against the Czech Republic.
"I don't know if I can play or not but I will try," said Nishikori. "It's not going to be like surgery bad, but it's still...I'm feeling it, so I have got to see a doctor right now."
The walkover was the second of the tournament for Djokovic, the Serb also receiving a free pass in the third round when Florian Mayer pulled out, also with a groin injury.
Djokovic, a three-time winner on the Miami hardcourts, will now await the winner of the other semi-final between world number one Rafa Nadal and Czech Tomas Berdych.
Djokovic should be well-rested for Sunday's final, not having played in four days and contested just three matches the entire tournament.
"It's not the first time it happens to me (a walkover), maybe it is the first time twice in the same tournament but it is the way it is and you kind of have to deal with that mentally," said Djokovic. "I practiced today, 30-40 minutes on center court, got good rhythm and trying to keep up with what I have been doing.
"I won in Indian Wells, gave me a lot of confidence, played a lot of matches so hopefully it will pay off."
(Reporting by Steve Keating in Miami. Editing by Pritha Sarkar and Gene Cherry)