Stop Android from killing Runtastic
Hello fellow OnePlus user! I had this same problem on my OnePlus 5. Turned off battery optimisation, still no dice. It was quite frustrating. I mean, I have 8 GB of RAM, why would it need to be killed?

Well, it turns out OnePlus has an additional setting: "Advanced optimisation". You can access it by going to Settings &rarr; Battery &rarr; Battery Optimisation and press the 3 dot menu on the top right. Turn it off. 

Advanced optimisation is extremely aggressive. I was even missing emails because of it. Turning it off immediately fixed the problem for me, and I haven't really felt that much of a difference in battery.

P.S. You can turn on optimisation for Runtastic back on.