On the error image appears the arrangement between ["xxxxxxxxxxxxxx@nnnnn"], in the last image, from Companion in Label2 appears a clean arrangement xxxxxxxxxxx@nnnnn
Why? What is that? With the inactive blocks (bottom-right) I try to "clean", to double "clean"... nothing!!!
With this, I fight a month (I learned a lot in that month). After a month of unsuccessful trying I made the above big blocks image that works like a charm. But... It was needed to make another global variable, compare the content of what came from tagData with that global variable, and select from that global variable the index, that is contained in tagData... Complicated... even for me.
if you want to change a component to a string, you will get a string like packages plus random text like. you can consider it's as the id of the component. it's unique.
but you can not convert this id string back to a component.
With that component/string, I fought a month to find a solution with 647 blocks... As you say... I think very complicated... but yesterday, I was just furious and I found another solution with only 159 blocks!!! But... with Dynamic Components. As dynamic components don't know to show a .Parent of a component (or I don't see it), my goal for today is to use the CompCreator with the same technique.
BTW can you/want/have time to make an extension like "DragAndDrop" with an added function?! a function that gives a component when is caught to be dragged, before the drag.complete (get the component name that is in the "air")?
when catching a component/arrangement for Dragging, before Drop, when are "in the air" know the name of the arrangement/component to deregister from drop, to not drop on himself and crash the companion.
I push the limits of DragAndDrop extension beyond Ken's demo .aia.
Please just run this .aia. Moove an arrangement about 10 px and let it drop on itself. This action will crash the companion. As I register the same arrangement for drop and for drag when I work on a real device and I lose an arrangement from drag, that arrangement drops on itself and crashes the companion.
Simplified version of above .aia. This is the final version for me as DragAndDrop that I will use on my app. Need more things in the future, but it just works perfectly with only 169 blocks. The only bug is that crash when an arrangement drops on itself.
PS - Catch and drag arrangements on the big rectangle, you can move an arrangement on another arrangement, or you can delete an arrangement by moving it on the bottom-right small square.
@TIMAI2 Just imagine the potential of that approach only for the open-source communities, like Arduino World (I don't speak about industrial automation potential...). To have the possibility to drag and drop gauges, sliders, sensors, LED's, esp32, and so on... Just push a button and connect them all.
This kind of approach can open a new window on the "big screen community". Real estate, architecture, maps... You name it. But for that, a DragAndDrop extension is needed that doesn't crash.
In fact, the compatibility between DragAndDrop, CompCreator, and DynamicComponents, from my tests, is the key (as doesn't exist an extension that does alone, all that).
I'm 100% sure that DragAndDrop creates a "paradox" when wants to drop on himself, it is a bug of it. Ken omitted to include a condition to prevent this behavior (almost sure then don't think at the possibility that somebody will use that extension for that purpose.). It is a great pity that it has this bug because it is the only extension that can "slide" when dropped.
Given that it does not crash for me, it could well be a local/hardware issue at your end. Take @Taifun's advice, and run logcat to see what is causing the crash.
I am also concerned that you may be running two component creation extensions in your larger app, they may have some conflict with each other? Best to pick just one, and only one. They both do the same thing.
From the hardware point of view, I'm 100% sure that is not. Can be from the companion?! But companion that runs on 3 devices... I don't think so. From CompCreator together with DynamicComponents I'm pretty sure that is no problem because I used them together in another test and it works great.
I'm 100% sure that is the DragAndDrop fought because if I don't use it to drag and drop on the same arrangement all works great!
@Taifun Can you please test this .aia to see if it on your part crashed?
I'm not sure that both do the same things, for example, DynamicComponents can't show .Parent, .Children and (for that reason a part of the logic from DragAndDrop) and CompCreator don't have an "id" associated with a component to create the logic behind tagData for every arrangement created (to create and identify multiple same arrangements, eg: VerticalArrangement, with different attributes).
So for me, they both, one complements the other. It is just an opinion(or I don't discover how to do only with one of them, the above .aia).