At Wimbledon last week, Kyrgios had to retire after the second set of his third-round match against Felix Auger-Aliassime because of a strained abdominal muscle.
He said it was a heartbreaking way to lose, and later foreshadowed his Olympic decision when he said if he played in Tokyo, he wanted to do it with full crowds, with his support team there and he wanted to be able to watch other athletes compete.
A ban on foreign fans was imposed earlier this year but local organizers had hoped to have local spectators for events in venues up to 50% capacity.
The decision to ban fans from all the Tokyo area Olympic venues came after Prime Minister Yoshihide Suga put the Japanese capital under a COVID-19 state of emergency because of rising new infections and the highly contagious delta variant. That means the Tokyo Games will be a largely TV-only event.
Kyrgios has stayed mainly in Australia during the pandemic and skipped the French Open before traveling to Wimbledon.
"I will also take all the time I need to get my body right," he said in the statement posted on Twitter.
"Good luck to all the Aussies competing and I'll see you back on the court real soon."