This has been also my gripe with Android. I have been developing for Android for over 5 years, and slowly switching to MBP, Xcode and iOS development since last year. And not turning back to Android dev for the meantime. My iPhone5s is still using the latest iOS version, so I have all the next several years to use this as a test device.
While Android on the other hand, I have countless dead phones because either Android N is not coming on it, especially Android O. And the Pixel phones from last 2 years is gonna be dead within this year. I feel like Google has no hope on how to solve this anymore. My minimum SDK is still at 19. My Android code has a lot of Build code check for backwards compatibility. Compared to my iOS code, there is completely none. Google should have address this issue since Marshmallow. But it is too late now.
And there is no Nexus phones here, so the devs here only has Samsung, LG and low cost phones which has no Google support.