I have been struggling with importing/exporting solutions between environments in Power Platform using Azure DevOps (https://dev.azure.com/). I have set up at pipeline which exports a given solution from a DEV environment to source control in an Azure repo. I have also setup a second pipeline which takes a solution from the repo, packs and exports it to a target environment. The solutions are developed and checked to source control as unmanaged; and the pipeline which exports them to the target environment has "Export as managed" checkbox checked.
Upon trying to run the pipeline, I am thrown the exception:
##[error]Unhandled exception:
Exception type: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]
Message: Solution manifest import: FAILURE: The solution is already installed on this system as a managed solution and the package supplied is attempting to install it in unmanaged mode. Import can only update solutions when the modes match. Uninstall the current solution and try again.
In the picture I have attached, you can see the pipeline in Azure DevOps.
I have also tried to uncheck the "Import/Export as managed" and the pipeline runs successfully, but when navigating to the target environment, the solution is present but once I click the app, the component is missing.
Thank you in advance.