But now, as Jokowi seeks re-election, he seems to distance himself from Beijing and downplay the importance of China-funded projects in Indonesia.
It is a pattern that is developing across Southeast Asia and beyond Be worried about Beijing as Chinese investment and relations become an uncomfortable, if not downright toxic, election question.
Growing skepticism about Xi's Signature Belt and Road initiative (BRI) is threatening to exacerbate the tensions that many countries in the region are facing with Beijing over territorial disputes, as both China and the US have come under pressure long-lasting trade war continues to fight for power.
If Widodo's camp sounds defensive, that is because his alleged ties to Beijing have become an important line of attack for rival Prabowo Subianto. After Jokowi had stressed Prabbow's criticism that he was not Muslim enough when he selected an Islamist cleric as his counterpart, the retired general, after Chinese investments in Indonesia once praised by the president, has gone down hard.
Anwita Basu, an Economist Intelligence Unit analyst, said "anti-China rhetoric was on the rise throughout the campaign."
"The Chinese community in Indonesia – which was mostly entrepreneurs and traders – has long faced resentment and discrimination because it controlled large amounts of wealth," she told CNN via email. "These issues are touted and popularized during the election periods, and this year (Prabowo) has used them as a means of questioning Jokowi's loyalty to his own nation."
"It's opaque and not transparent – even US Cabinet members have trouble getting data and information," Lembong said.
Running on Anti-China
During the Indonesian elections, Jokowi still seems to be losing, and a Prabowo presidency seems to be a long way off. Recent history shows that Beijing can not afford to be complacent.
In January 2018, former President Mohamed Nasheed accused Yameen of allowing China to "land grab" in the country. After taking power, its Maldivian Democratic Party pledged to "end China's colonialism" and renegotiate its loans with Beijing.
China has vigorously resisted such criticism, claiming it is being subjected to double standards.
Loss of Luster
As China prepares for an important belt and road summit this month, there are signs that Beijing is looking to revise the initiative to address some of its most pressing issues and concerns to defuse the criticism of foreign partners.
While outweighing China's repercussions in countries like Indonesia and Malaysia from others like the Philippines, which approached Beijing, EIU analyst Basu said: "Many countries are becoming cautious given the lack of transparency in terms of funding offered stay "for BRI offers.
The backlash against BRI, which seems to have hit the Chinese leaders seemingly unprepared, has shown that Beijing has little to offer its neighbors alongside investment – many of which are either neutral or opposed to important foreign policy issues.
In an attempt to balance the increasingly hostile US and ward off the negative effects of a temporarily suspended trade war with Washington, China notes that its traditional methods of acquiring friends in Asia are losing its luster. And the closer it gets to superpower status, the more influence and power can be put into it.