U.S. companies operating in China plan to increase investment in the Asian nation this year as rising consumer spending and improving profits offset trade tensions.

Almost 62 percent of companies surveyed by the American Chamber of Commerce in Shanghai expect to boost investment, led by technology hardware, software and services companies, as well as aerospace and aviation firms, the group said in a report Thursday.

“Despite U.S.-China trade frictions clouding the bilateral relationship over the past year, most U.S. businesses continue to perform well in China,” the chamber said. “Uncertainty about U.S.-China trade policy had a limited impact on investment and more companies are producing goods solely for the Chinese market.”

But given the survey was conducted before U.S.-China trade tensions ratcheted up this month, the firms may be overly optimistic. The Trump administration on July 6 imposed 25 percent duties on $34 billion in Chinese imports. China immediately retaliated with duties on the same value of U.S. goods, including soybeans and cars. Earlier this week the U.S. unveiled a list of Chinese imports worth $200 billion that could face higher duties.

“There’s an impact for sure,” Stephen Shafer, Greater China president at 3M, said on the sidelines of a media briefing about the survey. “We are more of an importer in China and we are impacted more by the Chinese tariffs.”

Ken Jarrett, president of the American Chamber of Commerce in Shanghai, said there are concerns among some U.S. companies in China that they will be targeted by the Chinese government as a result of the trade conflict.

“For companies at the moment they have been going through a mental check list of what they could encounter in the forms of retaliation. There are other ways that China can show its unhappiness,” Jarrett said. “Typically it could be a form of regulatory harassment. For example, things coming into the country held up by customs.”

Companies surveyed by the chamber saw broadly positive operating results as the yuan kept stable against the dollar, financial deleveraging continued, consumer spending remained firm, and the global economy supported demand. About 15 percent of the companies surveyed reported “very profitable” businesses in China, the highest proportion since 2004, while another 62 percent said their businesses were “profitable.”

About 85 percent of the companies planning to expand investment this year are in the technology hardware, software, and services space, according to the report.

Still, regulatory barriers and persistent government favoritism toward local companies impede U.S. companies, and market access restrictions and the distorting effects of China’s industrial policies concern members, according to the survey of 434 companies conducted between April 10 and May 10.

Lack of intellectual property rights protection and enforcement, and difficulties in obtaining required licenses remain the top two challenges foreign firms face in China, the chamber said.

“As China looks to the future, it should note lessons from the past,” the chamber said, citing Japan’s failed experiment with state industrial policies to finance and nurture companies. “Far better would be to improve market access, better protect IP, respect data security and thus create the conditions for national success.”