New York (CNN Business) Apple has a big China problem, and it's making investors very nervous.

Apple ( AAPL ) warned investors to expect lower sales from the holiday quarter due primarily to "lower than anticipated" iPhone sales in China amid an ongoing trade war with the United States, as well as other factors like the company offering cheaper iPhone battery replacements, according to a letter from CEO Tim Cook on Wednesday.

After decades of expansion, the Chinese economy is slowing down. Growth in 2018 is set to be the weakest since 1990. And 2019 looks even worse. The world's second largest economy, China is feeling the effects of a darkening trade outlook and government attempts to rein in risky lending after a rapid rise in debt levels.

China is a huge market for Apple, making up about 15% of its revenues globally.

"While we anticipated some challenges in key emerging markets, we did not foresee the magnitude of the economic deceleration, particularly in Greater China," Cook wrote in the letter. He pointed in part to "rising trade tensions" with the United States.

Read More