But Chinese-backed ventures have also hit snags in Africa.

Kenya has now borrowed far more from China than from any other country. But it has also come to depend on a flood of Chinese manufacturing imports, a trade imbalance that makes it harder to raise foreign currency to pay off debt. Kenya’s trade with China has grown eightfold in the past decade, according to President Uhuru Kenyatta, who complained at a conference this month in Shanghai that the trade was skewed in favor of China.

The monetary fund has flagged Djibouti, site of a large Chinese military base with live-fire exercises in the desert, as having potential problems with mounting debt, most of which is owed to the Chinese government’s Export-Import Bank, according to a report this year from the Center for Global Development. Yet Djibouti shows no signs of limiting new borrowing for projects, and it’s unclear whether these will earn enough revenue to pay off their debts.

In Nigeria, Chinese projects have been dogged by accusations of corruption, poor decision-making, and in some cases shoddy construction. Yet the nation is still turning to China to build a coastal railway and myriad other projects.

Chinese debt has become “the methamphetamines of infrastructure finance: highly addictive, readily available, and with long-term negative effects that far outweigh any temporary high,” according to a recent article by Grant T. Harris, who was President Barack Obama’s White House director for Africa from 2011 to 2015.

The added fact that China has flooded African markets with low-cost manufactured goods means that many African factories have been driven out of business, making it harder for African countries to raise the hard currency — mostly dollars — that they need to repay loans from Beijing.

China has extended lines of credit to nations rich in natural resources like oil, bauxite, iron and other metals. So even if a resource-rich developing country has trouble repaying its loans for a while, the thinking goes, it can pay with natural resources sooner or later. China also gains politically by extracting promises of support for the Beijing government over Taiwan as a condition of eligibility for a loan.

At the China-Africa Forum for Cooperation summit in Beijing this month, China announced that it had set up a $60 billion fund for African infrastructure projects to strengthen ties with the continent.