Stop Android from killing Runtastic Runtastic is an app for tracking the paths you ran, how fast you were, etc. It worked great for me for many years but almost 2 years ago started crashing on virtually any run.

A few months ago, I tried different running apps but all of them crashed too. The only way I have found to somewhat reliably stop this from happening is to open the app every 2 to 5 minutes which is really obnoxious to have to do.

I already tried turning off battery optimization for Runtastic in the Android settings. This seems to make the problem less severe (though I'm not sure) but doesn't eliminate it. Furthermore, occasionally battery optimization for it just turns back on automatically for some reason.

How can I tell Android that Runtastic may use however much battery (mostly via GPS usage, I guess) whilst in the background without getting killed?

I use a OnePlus 3 running OxygenOS 5.0.1 which is based on Android 8.0.0.
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.