For a long time, it looked as if Apple had found the key to unlock the Chinese market. A world-famous brand, extensive factories in China and cooperation with the government’s demands led to booming sales of iPhones and other Apple products. Recently, however, the company has discovered that even the best-behaved of Western multinationals may not be able to hold the government’s favor for long.The Chinese government just shut down two of Apple’s key service products, the iBooks Store and iTunes Movies. It has also denied Apple the right to trademark the name “iPhone,” allowing other companies to use the name for their own, non-Apple-related products. Meanwhile, Apple’s outperformance in China may be coming to an end, as revenue in the Greater China area plunges and consumers turn to domestic manufacturers. Apple’s stumbles in China seem emblematic of a broader realization: US companies have less of a future there than many had hoped.For many years, the vast Chinese market – more than 1 billion consumers in a fast-growing economy – sent thrills of excitement up the spines of corporate managers throughout the developed world. Who cares about the stagnation in Europe and Japan, when China has many more people than all of those markets combined? Even as rising labor and energy costs reduced China’s advantage as a low-cost production site, the dazzling lure of the Chinese consumer pushed many multinationals to locate offices and factories in the country.Unfortunately, that promise turned out to be a mirage for many companies.If the Chinese government ever had any intention to step back and let foreign companies compete with domestic ones on a level playing field, it certainly now looks like it has changed its mind. Not long after multinationals showed up in China, they were made to hand over much of their technology to native competitors (almost all of which are directly or indirectly owned by the Chinese government). This was happening as early as 2006, as the Harvard Business Review reported:“These rules limit investment by foreign companies as well as their access to China’s markets, stipulate a high degree of local content in equipment produced in the country, and force the transfer of proprietary technologies from foreign companies to their joint ventures with China’s state-owned enterprises.” Proprietary technology is the most valuable asset owned by many multinationals. So China truly offered a lose-lose choice for these companies – either they could miss out on the Chinese market in the short term, or give away technologies that would allow Chinese competitors to challenge them all over the world in the medium term. Of course, given China’s high rate of industrial espionage, the penalty for operating in China was even higher than official government policy would suggest.Multinational companies often think very short term, so perhaps it isn’t surprising that many chose to make the devil’s bargain. Now the bill is coming due, as China’s government promotes its own national champions, many of which are now equipped with pirated foreign technology. Meanwhile, multinationals’ China operations have become less and less profitable as domestic competition has intensified. The Chinese government, of course, has aided this process by systematically discriminating against foreign companies, enforcing laws and regulations with regard to multinationals while looking the other way when a domestic company commits a violation. There are signs that some multinationals have had enough. Many are closing offices and factories in China, as costs rise and the government shuts foreigners out of the domestic market. Some recent examples include Microsoft, Adobe, Panasonic, Yahoo and Adidas. Between this and the effects of China’s general economic slowdown, foreign direct investment into the country – while volatile – has declined in the past few years.In the short run, this clampdown by China is bad for US companies. They’ll face Chinese competitors armed with transferred or stolen technology. Their supply chains, which had grown dependent on cheap Chinese production costs, may also be disrupted. And they’ll be shut out of one of the world’s largest markets, losing much of the investment that they plowed into expansion there. But in the long run, I suspect China will suffer even more. When foreign companies pack up and leave, it’ll get much harder to steal or force the transfer of their proprietary technologies – and these companies won’t make the same mistake twice.