Unable to import Power Platform solution because of dependencies

Here’s the scenario.

In my dev Environment I have a Solution with a Flow, Connection References etc. As part of testing something I added a bunch of Connectors to this Flow… realized I don’t need them any more, and so removed them from the Flow. I also removed any references to them from the “Connections” page of the flow and double checked that they do not appear as Connection References in the Solution.

However, when I exported this Solution as a Managed one to import into the prod Envrionment it complained that some dependencies were missing – specifically these Connection References I am no longer using. Wtf!

Having no idea what to do, and fooling around with various things as usual, I eventually solution.xml file of the exported solution. There I found the following:

I guess I could make a copy of the file, remove these bits, then add it back to the zip and import… but that would mean doing this each time I export import. Instead I realized I could go to the Solution in the dev Environment, go to the Overview page, click on the 3 dots next to Flow, and select this option:

That goes ahead and adds these Connections back to the Solution. Yes I don’t use them any more and don’t care for them, but at least this way I can export and import it without an issue. There must be some other way of removing unused Connections in a cleaner fashion I suppose but I couldn’t be bothered to find it. :)