build quality issues are not widespread to the whole android ecosystem. apple kind of get the crown as long term phones because software support and hardware warranties, but it's not as to say that there are no android phones that can match them in half life.
For those people, the alternative Android offerings just aren't on the radar.
On the other hand, the apple ecosystem doesn't have fire sales like Android does, getting last year's hip kick-started flagship got $200-300 isn't so bad, even if you need to do it way more often. See Amazon fire phone, nextbit Robin, essential phone; these were all a great value when they went on sale, although the fire phone has no back button, so it was more terrible than the others, but also cheaper.
I suffered android for a number of years and you're right. Trash. Even the flagships. The worst bit is when they go wrong or have quality problems. My experience of service from Samsung and Motorola is sending it off, losing it for 4 weeks and it coming back with a ransom charge and a lie that I water damaged it which I didn't. The Motorola was the worst because it just went to sleep one day and never woke up again. This was 2 hours after I first powered it up.
My wife had a 6s with a light patch on the display, took it in Apple store and they swapped the screen out there and then. No charge.
My dongle failed within a month. None of my local stores sell the adapters that include a DAC which the Pixel requires, so I've now been stuck with getting it replaced through Google Support on three different occasions. You can imagine how that went?
I've given up on it now. They just do not last. Forked out $60 AUD for a Bluetooth dongle for my Shure SE215s which has served me well. Unfortunately the battery life leaves alot to be desired.
Having said that, both my Pixel 1 and 2 died within 6 months of purchase. Pixel 1 was purchased in Jan 2017. Had the infamous microphone stopped working bug in March 2017. Google replaced with a refurb which lasted 1 year until the microphone and headphone jack stopped working. Got a pixel 2 which also had quality control issues where several months later it was stuck on a perma startup booting loop. I made the mistake of buying the pixel 2 online so I couldn't get it covered under warranty.
And here we are with the Pixel 3. As amazing as night sight is, it annoys me to hell that my girlfriends iphone 6s is still going strong after years. Pixels really are not that durable which sucks because the best part of a pixel is still miles and leaps above the competition.
EDIT: The newer Iphone cameras are getting better. If the Pixel 3 also dies within a few months, then I'm going to Apple because I can't justify buying a flagship phone every year.