One of the dread errors with design-time packages in Delphi, which means packages that register install new components onto your Palette, is this error:
Component TSomething can't be registered by package something_design.bpl because it has already been registered by package something_design.bpl.?
I already know this much:
If you had two copies of the BPL and you loaded one, but another package that depends on the BPL tries to load another, and it tries to load a second copy, you get this error.
Sometimes, there are weird things about implicit imports that require you to fix the implicit import warnings, clean all your artifacts up (dcu,dcp etc) and try again, and this goes away.
However, in the case that NEITHER of the above is fixing the problem, how do you fix the problem?
It seems to me, that there is only one copy of this BPL on my hard drive, and the path points to it, and somehow, a package is doing a "stealthy" background load of the package, before the IDE can see it, and then the IDE itself tries to load a package which has gotten loaded into the memory of the IDE using the Win32 call LoadLibrary and the second load which is the IDE trying to load this package, is causing a failure.
I'm looking for:
A. How to figure out what is wrong, and how to fix it.
B. Ways to avoid this (defensive practices or tools to scan your packages or your delphi IDE configuration.)
C. Workarounds. For example, I have found that launching Delphi ide (bds.exe) with the -np
parameter, then loading my project later, not at initial IDE startup time, sometimes works around the problem by delaying project/form opens until a later time, when the Delphi IDE seems more stable.
First, are you working in XE? I struggled with this after I made a component to replace the calendar earlier this year. I'm still not exactly sure what fixed it. But I believe the error has to do with the paths. Ensure it's not included twice by being visible to 2 path definitions.
If it's being used, you should be able to see what packages are included.
Hope you can make sense out of this, I'm still wondering what I did back then.