Having hardware which lasts is good, but they also need to make sure the software lasts. A phone is hardware + software, both need to last for the phone to last.
I know Apple is much better at this than Android, but still, they could be even better. My iPhone X does everything I need, physically it's still in pristine condition (so well done to Apple for that), but they're going to drop software support soon. Meaning no security updates, and apps will eventually stop supporting the old OS and thus the phone.