FRANKFURT (Reuters) - BMW's BMWG.DE second quarter earnings fell by a fifth, hit by exchange rate moves and investments in manufacturing electric and hybrid cars to help meet stricter emissions limits.

However, the German automaker stuck to its full-year forecasts, avoiding the profit warnings that have beset the industry and helping to push its shares higher on Thursday.

“There are no major hiccups and as the product momentum is improving, so will profitability and cashflow. In an extremely volatile auto world, this is very good news,” analysts at Evercore ISI said in a note to clients.

Carmakers are having to make huge investments into cleaner and self-driving technologies just as demand in China, the world’s biggest auto market, is falling and a trade war between Washington and Beijing is curbing global economic growth.

German rival Daimler DAIGn.DE and industry supplier Continental CONG.DE have both recently issued profit warnings, although Fiat Chrysler FCHA.MI and Volkswagen VOWG_p.DE stuck to their 2019 forecasts.

BMW said earnings before interest and taxes (EBIT) fell to 2.2 billion euros ($2.4 billion) in second quarter, hit by the cost of trying to meet stricter emissions rules due in 2021.

Investments in property, plant and equipment jumped 39% as the company opened a factory in Mexico and retooled its plants to introduce more flexible production lines help it double sales of electric and hybrid cars by 2021.

The Munich-based company said the operating margin at its automotive division fell to 6.5% from 8.6% a year earlier, despite a 1.5% rise in vehicle sales over the same period.

But analysts said the margin compared favorably with Mercedes-Benz’s 3.6% and Audi’s 8% given BMW sees higher volumes and a better mix of model sales in the second half of the year.

BMW reiterated its forecast for a significant decrease in group profit before tax in 2019 as well as a slight increase in vehicle deliveries, and an EBIT margin of 4.5%-6.5% in the automotive division.

At 1015 GMT, its shares were up 1.2% at 67.62 euros.