I only ever had one smartphone, and that's Samsung Galaxy S7 (bought in the year it hit the market: 2016). I will have to replace it very soon though because my banking app is going to stop supporting the Android version it has, and Samsung doesn't provide upgrades.
But... it's not really Android's fault anymore than this is Samsung's fault. The phone itself is in a good condition. The battery holds the charge for almost as long as it used to when bought. Maybe I'm not a typical user, or have very modest use patterns that allowed this phone to survive this long. Whichever this is, it shows that it's not really a problem of Android (I don't like the system for other reasons).
Before replacing, I'm going to try to install LineageOS on it, and, we'll see, maybe I'll get another couple years out of it.
At the same time span, my wife burned through 4 smartphones. All of them died for reasons unrelated to the operating system they have (i.e. were dropped, stolen etc.) It's possible that being, in general, cheaper and more disposable, Android phones don't live as long as iPhones, but this doesn't mean they shouldn't or cannot live just as long.