Apple has been more successful in China than any other consumer tech company. Now that’s a problem for Apple.

On Wednesday, Apple said it removed HKMapLive, an app used by protest organizers in Hong Kong, from its Chinese app store. The app, which lets users track police activity, “violates our guidelines and local laws,” Apple said. The company says it made the decision on its own accord and not because the Chinese state-owned People’s Daily had been publicly criticizing the app.

“Over the past several days we received credible information, from the Hong Kong Cybersecurity and Technology Crime Bureau, as well as from users in Hong Kong, that the app was being used maliciously to target individual officers for violence and to victimize individuals and property where no police are present,” Apple CEO Tim Cook wrote in a company memo on Thursday. “This use put the app in violation of Hong Kong law. Similarly, widespread abuse clearly violates our App Store guidelines barring personal harm.”

That followed Apple’s September 30 removal of the Quartz News app because it “includes content that is illegal in China,” according to a note the news publisher says it received from Apple.

Apple isn’t the only big company making decisions that look like they’re meant to appease China as that country’s standoff with Hong Kong protesters heads toward its eighth month.

This week, the video game studio Activision Blizzard punished a player who had won a tournament for one of its video games after he publicly supported the protests. The NBA has both apologized and unapologized after Houston Rockets executive Daryl Morey tweeted a message on behalf of the protesters. And Google has taken down a game app that lets players take on the role of protesters. (The Wall Street Journal reports that Google did so after Hong Kong police complained; a company representative says it didn’t receive a request from any government agency but took down the app on its own because the app violated its rules about exploiting sensitive news.)

But Apple is in a particularly difficult position, due to the company’s success in China: Unlike several other big consumer tech companies, which either do little business in China or none at all, Apple has thrived in China. The country is Apple’s third-biggest market, which generates some $44 billion a year in sales. And Apple’s supply chain, which lets it produce the hundreds of millions of iPhones it sells around the world each year, is deeply embedded in China.

Meanwhile, Apple has gone out of its way to promote itself as a tech company with deep commitments to social issues like privacy and environmentalism. And CEO Tim Cook has been outspoken about his disagreements with the Trump administration on trade wars, immigration policy, and Trump’s support of neo-Nazis.

So on the one hand, Apple is the woke consumer tech company that cares about you, your privacy, and the rest of the world. On the other, Apple is deeply enmeshed in a country that supports (state-approved) capitalism but not civil liberties.

Meanwhile, many of America’s biggest tech companies don’t have this problem because they’re barely in China or not in China at all. Almost all of Google’s sites and services, for instance, are blocked in mainland China. Twitter, Facebook, and Netflix aren’t there at all. Amazon has a very small presence.

But that’s not due to lack of trying. Google spent years trying to work with China before bailing in 2010. And when news broke last year that Google was trying again and had begun work on a secretive project to build a censored search engine for the country, outcry from the public and its own employees pressured the company to halt the project, at least for now.

Amazon spent more than a decade trying to crack the Chinese market with very little to show for it today. Facebook, which has been blocked in China since 2009, also spent years of courtship to get back in, including multiple visits from CEO Mark Zuckerberg, who also made a public pledge to learn Mandarin. In 2016, Netflix CEO Reed Hastings was hopeful that he could work with Chinese regulators; this year he said that wasn’t going to work — “We will be blocked in China for a long time.”

This week’s news suggests that those guys may be lucky they’ve failed to get in. Aside from ethical concerns about compromising with Chinese authorities to get access to the country’s billions of consumers, working with China could become bad for your brand, as politicians and commentators pile on the companies who do it.

“Dealing With China Isn’t Worth the Moral Cost,” says the New York Times columnist and former tech reporter Farhad Manjoo, who calls the country “a growing and existential threat to human freedom across the world.” Republican Sen. Marco Rubio accused China of “using access to market as leverage to crush free speech globally.”

Just as concerning for big internet companies is that China now looks like it’s willing to punish companies for things that happen outside of the country: Daryl Morey’s supposedly incendiary statement was made on Twitter, a service that’s not available in China. Imagine what would happen if YouTube, which struggles to deal with the millions of problematic videos its users upload each month, had to take responsibility for pro-democracy messages its 2 billion users made, too.

Plenty of US companies work in and with countries that require them to make moral compromises. Facebook, for instance, finds itself frequently pulling down videos and posts because they upset Turkey’s censors; Netflix took down an episode of comedian Hasan Minhaj’s Patriot Act in Saudi Arabia because it was critical of Crown Prince Mohammed bin Salman. The standard argument these companies all make is that those countries are better off when they have access to their products.

This is Apple’s argument, too. “We believe our presence in China helps promote greater openness and facilitates the free flow of ideas and information,” Cook told Sen. Ted Cruz (R-TX) and Sen. Patrick Leahy (D-VT) in a December 2017 letter. “We are convinced that Apple can best promote fundamental rights, including the right of free expression, by being engaged even where we may disagree with a particular country’s law.”

Left unsaid in Cook’s letter is that Apple has to do business in China.

Unlike tech companies that haven’t broken into the country or only do minor business in it, Apple is now so deep in China that leaving it could be catastrophic. Even if the company was willing to forgo the $44 billion a year in sales it makes in China, it can’t leave the deep network of suppliers and assemblers that build hundreds of millions of iPhones every year.

Earlier this year, in response to the escalating US-China trade war, Apple floated the idea that it could move some of its production outside of China to hedge its bets. But it was only willing to suggest that it would move a third of production.

So even if Apple decided to make the wrenching decision to get out of China today, it couldn’t. It is stuck there, for better and for worse.