'-----> Building on the Heroku-20 stack -----> Swift app detected -----> Using Swift 5.2.1 (from .swift-version file) -----> Using built-in clang (Swift 5.2.1) -----> Installing swiftenv -----> Installing Swift 5.2.1 ! Swift 5.2.1 does not support Ubuntu 20.04. ! Please update your project to a more recent version of Swift. ! ! You can also downgrade your stack for the time being (not recommended), ! using the heroku stack:set command or the dashboard. ! Push rejected, failed to compile Swift app. ! Push failed'
Correct, Swift 5.2.4 was the first to bring Ubuntu 20.04 support (see the downloads page). Generally, try to run the latest Swift version, even if you wrote your code for Swift 5.2, you should use the latest Swift version. So as of today, I'd recommend you use Swift 5.3.3 which should not require any code changes on your end.
If you always use the latest Swift version you will benefit from security fixes, bug fixes, and performance improvements that went into the language. Swift is also source stable, so if you find a program that compiles with 5.2.1 but not with 5.3.3, that'd be a bug (please report).