Hong Kong (CNN Business) China's economic growth has slumped to its lowest level in nearly three decades, but the trade war with the United States isn't solely to blame.

Gross domestic product growth dropped to 6.2% in the second quarter, the weakest since the government started publishing quarterly figures in 1992, the national statistics authority said this week.

Soon after the figures were published, President Donald Trump tweeted this

"The United States Tariffs are having a major effect on companies wanting to leave China for non-tariffed countries. Thousands of companies are leaving. This is why China wants to make a deal with the U.S., and wishes it had not broken the original deal in the first place."

Despite a truce agreed between Trump and Chinese President Xi Jinping last month, US tariffs on $250 billion worth of Chinese goods remain in place and have already hit China's manufacturing and agricultural sectors. Some American companies are also switching to suppliers in other Asian countries like Vietnam, Taiwan, South Korea and Bangladesh.

But analysts argue that the yearlong trade war is not the biggest drag on the world's second largest economy. The slowdown has as much to do with a debt mountain and cautious consumers.

Debt and defaults

China has been struggling for years to rein in high levels of debt, arising from a massive stimulus package launched during the 2008 financial crisis.

While the stimulus boosted economic growth, it resulted in a $40 trillion mountain of government, corporate and household debt worth more than 300% of China's GDP as of March 2019, according to a report from the Washington-based Institute of International Finance this week.

China's overall debt now accounts for about 15% of the global total, the IIF added.

The Chinese government has reacted by tightening regulations in the financial system, scaling back bank lending, and clamping down on unregulated lending, also known as shadow banking.

But these efforts to reduce China's reliance on debt-fueled growth have also made it more difficult for companies to obtain financing, especially private sector firms that usually find it harder to raise funds from banks than larger but less efficient state-run firms.

Last year, defaults by Chinese companies hit a record high. In the first six months of this year, the number of defaults increased more than threefold from the same period last year, according to data compiled by Wind, a Chinese financial data provider.

"Credit is still not flowing to the sectors that need it most," said Stephen Innes, managing partner of Singapore-based investment firm Vanguard Markets. Innes estimates that around 50% of the defaults came from China's large manufacturing sector, mostly by private companies.

Consumers are cutting back

The hit to growth this year has come from Chinese consumers, who hold off spending because they worry about the economy's future and rising personal debt levels. Elevated property prices have also strained their purchasing power.

Retail sales grew by 8.4% in the first half, down from 9% in the same period last year. And some of the world's biggest companies are feeling the pinch.

Apple's AAPL sales in China have tumbled. Its revenue in the Greater China region, which includes Hong Kong and Taiwan, dropped 21.5% in the second quarter from the same period a year ago. Greater China accounted for about 18% of Apple's total revenue.

Weak car sales are also a big part of the story. Total spending on cars increased by just 1.2% in the first six months of the year.

Ford said earlier this month that it sold nearly 22% fewer vehicles in China during the second quarter than in the same period a year ago. General Motors posted a 12% drop in vehicle sales in China for the quarter.

Steady deceleration

China's economic slowdown predates the trade war by several years.

Growth hit a record high of 14.2% in 2007 but has been steadily falling since as China grapples with several pressures on its economy.

The government has lowered its growth target to a range of 6% to 6.5% for this year.

China's efforts to shift its economy from one focused on manufacturing to one driven by technology and services have also contributed to the slowdown.

Beijing has been cutting excess capacity in heavy industries such as steel, cement, shipbuilding, while encouraging domestic firms to shift to higher value-added areas.

Tencent TCEHY Alibaba BABA While that transition has seen the rise of giants likeand Huawei, it has also caused growing pains as traditional manufacturing workers struggle to make the shift.

China has recently cut taxes and increased infrastructure spending in a bid to prevent a hard landing for the economy, but analysts say the country's model of state-sponsored growth may no longer work.

"Continued reliance upon infrastructure projects with decreasing marginal returns seems unlikely to revive China's economy, and its state-run capital allocation system is an irrational and inefficient mess," said Brock Silvers, managing director for Shanghai-based Kaiyuan Capital.

"Beijing has been working furiously to fix the economy... but its old methods may not fix its new problems," he added.