DECOUPLING: Apple’s Chinese dream is over.

Apple’s relationship with China was one of the biggest bets in the history of the technology business, and it turned Apple into one of the largest and most-admired companies in the world. Its end will threaten Apple’s decade-plus dominance.

Under the leadership of Tim Cook, Apple has added nearly $2 trillion to its revenues by taking advantage of China’s invitation. Credit for Apple’s growth also goes to Terry Gou, founder of its most important contract manufacturer, the Taiwan-based Hon Hai Precision Industry, better known as Foxconn. And there are countless other Taiwanese firms that have helped build out the supply chain for Apple and other companies in China.

The consumer products that Apple made in China it changed the way we all live. But both Chinese and American tech figures have been thinking for years about what to do when the party’s over.

Apple’s biggest problems might lie right here at home. The company has managed to alienate developers, free speech enthusiasts, and lawmakers on both sides of the aisle.

Getting out of that mess might make getting out of China look comparatively simple.