In the gloom of China’s economy, one area of business is booming: cosmetics.

After enduring nearly three years of mandatory masks and frequent lockdowns during the pandemic, many Chinese consumers, wary of big-ticket purchases like apartments, are now splurging on lipstick, perfume, moisturizers and other personal care products.

But cosmetics companies from France, Japan, South Korea and the United States, which have invested heavily in China, are missing out on a lot of the action.

As China’s cosmetics companies are booming, imports of cosmetics are wilting under regulations that the country imposed on foreign manufacturers during the pandemic.

While China’s trade conflicts with the West over semiconductors pivot on national security and technological innovation, the dispute over cosmetics is largely about money.

“I’m not talking about peanuts,” said Bruno Le Maire, France’s finance minister. “For many French companies,” he added, China “represents between 30 and 35 percent of their total revenues.”

During a visit to China last month, Gina M. Raimondo, the U.S. commerce secretary, said the United States wanted to expand its exports of personal care products. “No one can argue that health and beauty aids interfere in our national security,” Ms. Raimondo said.

Under rules that China introduced in 2021, companies must divulge every ingredient in their products and the precise quantities used. They must upload to a Chinese database the addresses of all ingredient suppliers as well as where the ingredients are assembled. Foreign companies fear that divulging those details could allow low-cost Chinese manufacturers to copy their products.

One of the most contested Chinese mandates is that many products, such as hair dyes or sun creams, must be tested on live animals before they can be sold to Chinese consumers — a practice that many global cosmetics companies have stopped.

“It’s not only the requirements that are onerous but the timelines under which things need to be done — they are unrealistically short,” said Gerald Renner, the director of technical regulatory affairs at Cosmetics Europe, an industry association.

Big companies like LVMH or L’Oréal have the resources to meet the regulatory demands. But some smaller players are pausing sales to China until there is a less time intensive and expensive way to meet the requirements.

Led by the French government, the European Union and 11 cosmetics-exporting nations, including the United States and Japan, are pushing China this year to repeal many of the requirements. President Emmanuel Macron of France raised the issue with China’s leaders during his visit to the country in April. Mr. Le Maire pressed it again when he visited Beijing in July, saying the concerns had been “at the core of discussions” with his Chinese counterparts.

Mr. Le Maire said he and Vice Premier He Lifeng of China had agreed to set up a working group to create common standards that would meet in Paris before the end of this year. But there is no guarantee that talks will resolve the dispute.

China is the second-largest beauty market in the world, trailing only the United States. Yet doing business there has long been difficult for foreign companies.

For decades, China mandated animal tests for most cosmetics, even for those that had been proven safe and sold by brands elsewhere. Brands either quietly tested their products on animals in China or gave up on their imports.

China dropped the animal test requirements a decade ago for many products made in China and, in 2021, for imported cosmetics that do not make health claims.

But China still requires animal testing for “special cosmetics,” which include products with sunscreen or antiperspirant as well as products like hair dye or skin lightener. According to Jason Baker, senior vice president for PETA Asia, these animal tests include forcing animals to swallow or inhale a test substance or applications to their skin or eyes. Rabbits, guinea pigs and mice are most commonly used.

Michelle Thew, the chief executive of Cruelty Free International, an advocacy group, added that China topped the list of countries using animals in testing and research for a variety of purposes — about 20 million animals annually — followed far behind by Japan and the United States.

The international beauty and personal care industry supports efforts to reduce animal testing for products sold in China, for both domestic and foreign manufacturers. Unilever, which makes Dove and Vaseline and owns the Dermalogica skin care brand, said it had been working with academics and the Chinese authorities to phase out the need for imported cosmetics to undergo animal testing.

“The move from animal testing to paper-based risk assessments is undoubtedly a positive one,” said Carl Westmoreland, the director of the Unilever safety and environmental assurance center. “There might be more paperwork involved, but we see it as a big step forward.”

The Chinese government’s regulatory agency, the National Medical Products Administration, did not respond to a list of questions faxed on Aug. 8. The foreign ministry declined to address the issue.

Recent statistics show how rapidly foreign cosmetics companies have lost market share to domestic competitors in China. Retail sales of cosmetics in China in the first half of the year rose 8.7 percent from the first half of 2022. But overall imports fell 13.7 percent.

The difference between the rising sales and the shrinking imports reflected gains for factories in China, many of which are owned by Chinese companies. Proya Cosmetics, based in Hangzhou, reported a 35 percent increase in sales in the first half of this year compared with a year earlier.

“There is a rising acceptance of domestic brands,” said Chris Gao, a China cosmetics analyst at CLSA, a brokerage and investment firm in Hong Kong.

While LVMH and L’Oréal said they were seeing growth in their China sales, both declined to comment on the shrinking imports.

China’s customs data shows that imports of cosmetics, toiletries and perfumes from France to China, which reached $5.4 billion last year, were down 6.2 percent in the first half of this year from a year earlier. Cosmetics imports from South Korea and the United States were down 22.2 percent and 19.8 percent.

A crackdown by the authorities on traders in the duty-free hub of Hainan has also hit beauty sales for international players like La Prairie and Shiseido. Beyond the regulatory red tape, some foreign companies may be importing less because they already have a backlog of products in China.

While China’s duty-free stores work through the glut on their shelves, homegrown beauty brands are growing in popularity. According to data from Euromonitor International, a market research company, Chinese-born beauty brands have grown significantly in the past three years, making up 27 percent of the skin care and makeup retail sales among the top 10 brands.

And China is expected to only keep growing as a market. By 2027, the consulting firm McKinsey estimates, China will account for around one-sixth of global beauty retail sales.

Li You contributed research.