Can developers build applications for unsupported Android versions? My smartphone still works as a mobile phone. I would like to exploit it at its full potential but many applications don't support its "old" operating system Gingerbread 2.3.6.

I do not want to buy a new phone because it works well. However, I would like to develop apps for my personal use on this phone but Google does not support Gingerbread since 2017.

Can developers build applications for unsupported Android versions?

Note: the question is also about programmed software obsolescence. Currently, we cannot make libre software distributions on all devices. Android is an open source operating system so there may be possibilities to maintain smartphones despite proprietary locks (hardware and software). The question allows you to see what can be done for a working device: why a working Android device is become unusable? From my point of view, the device is still usable if someone maintains a functional development environment which allows to develop new applications.
You are free to build any app for unsupported versions of Android. However, you won't be able to publish on Google Play Store (if you intend to).

From an article published when Google ended support for ICS:


  First, Google won’t allow developers to publish apps that support the API level for ICS — that’s API 14 and 15. That means the oldest supported version of Android in the Play Store is Android 4.1 Jelly Bean (API 16).