Work is underway on Android 8.1, where one feature will automatically remove unused applications. The facilities will not, however, be easily accessible.

Android 8.1 Developer Preview appeared in late October, but works on this version are ongoing. According to information discovered by users of the XDA Developers forum, the new feature in Android 8.1 will reduce the size of applications that have been installed on the device and for a long time were not turned on. The function sysprop pm.dexopt.unopt_after_inactive_days corresponds to the function mentioned above. The easiest way to free up space will be to delete the cache files, ie downloaded images, data or enabled information. Unfortunately, the new feature would only work on Android 8.1, but not 8.0 anymore. If this was not enough to make the feature available, OEMs should be allowed to operate it on their devices. Otherwise you will not be able to use it. So it looks like most Android users will be happy with it for a couple of good months. Source: XDA Developers