GPS not working reliably I am facing the following problem:

There are times with cloudy or rainy weather, when I have the phone in my back pocket while sitting in a car. Nevertheless, the route I am driving is recorded.

There are other times when my phone directly lies under the windscreen with clear visibility and nevertheless I don't get any signal. At the same time, a navigation device lying directly beneath it works fine.

The same happens sometimes when I am walking through the nature. Instead of recording the whole track I walked, I have only parts of it, or sometimes even nothing.

If I notice this to happen if I am under the way, I see the GPS status app telling me that it has 3 or 4 satellites, and the AGPS age is usually 0 h.

Do I have issues with the software or rather with the hardware? I have a LG-D290n, if that matters in any way.
I had trouble with my gps on Samsung S6 ( using STRAVA) after an update. Times and routes were out of whack. I fixed the problem by turning off my Battery Power Saving in the settings under battery. This was causing problems with "ok google" as well. Now all is ok. Hope this fixes your problem.