Bowdark Lightbulb Logo
Bowdark
the bowdark blog

Switched OnSwitched On

Power AppsLow-Code / No-CodeDynamics 365

Microsoft Power Apps: Fixing Multiple Component Libraries Error

This article walks through a real-world Power Apps issue where conflicting component libraries block solution imports, and shows how to resolve it by identifying and removing hidden dependencies (via the Web API) so the solution can be deployed successfully.

Lori BeckDirector of Technical Delivery
Microsoft Power Apps: Fixing Multiple Component Libraries Error

I ran into a situation lately, where identical customizations had mistakenly been made to the command bar of a table in two different environments (Dev and UAT). While the customizations were identical, the command bar component library, of course, had a different id in each environment, which meant that when the time came to move subsequent changes to the command bar from Dev to UAT we were unable to import the solution, because a model driven app can have only one command library and importing this solution would essentially be trying to add another.

“The app cannot be associated to more than one component library.”

The first thing we tried was to remove the command item (i.e., the button) from the command bar in the UAT environment and trying the import again. That left us with a dependency error pointing to a Model-Driven App Element:

You might think that since there was only that one action in the library, and the action had been deleted, it would be a simple thing to delete the library… but apparently, there is no way to delete a component in the Maker Portal.

We thought we might be able to remove the reference by editing the solution file, and when we extracted it, we saw that that customizations.xml has an App Elements (appelements) section, which contained our dependency item.

It turns out, if you query the appelements table from the WebAPI, you can find the id of your dependency:

and you can use that id to send a DELETE request. (I’m using WebAPI Launcher in the XrmToolbox here.)

After that, the solution imported correctly. Problem solved 😊