I have checked the blockly classes but I can't find any way to get the error causing block. We all know that whenever a AIA is imported, if any property block doesn't exists, it corrupts the whole AIA and it's hard to know which block exactly cause the issue. I have seen the BlocklyPanel class, it contains codes but there is no way to get the block which is causing the error. It gives a LoadblocksException with no block's details.
I believe that in this community, we have many expert developers who can answer my question easily.
Implementing what you want will require changing the code in Blockly core. This is something we are trying to avoid as we attempt to migrate App Inventor to the latest version of Blockly. The challenge is that during loading when an error is thrown the block causing the issue isn't captured. Therefore, we don't have information that we can capture at the App Inventor level to propagate further. Of course, the other problem is that even if we tell the user about the offending block, the typical user won't have a means to address the problem.
Okay, can you link the class which handles rendering all blocks and throw error when the block not found in Blockly core ? I am very new to blockly. Also, why bad block implementation is done for only SimpleFunction and SimpleEvent. It corrupt project
only when SimpleProperty is not found
That actually shouldn't be happening. But if extensions are added and then the projects are played around with (extensions are deleted again or removed via WinZip / WinRAR), then it can happen that certain blocks can no longer be assigned (because the corresponding extension is missing). The same can happen when importing a project from AI2Offline to AI2 and vice versa.
See e.g. here:
This block does not exist in AI2 but in AI2Offline.
And this block does not exist in AI2Offline (but in AI2).
Do you have an example app that demonstrates the problem? The shape of a SimpleProperty block is always determinable from the XML so even if the property isn't available it shouldn't be an issue. SimpleEvent and SimpleFunction are more complicated because the shapes can change over time if we change the signature of the underlying function.
Topic where the author had a problem with the project. Built a project in app inventor - offline. It had a property block that wasn't in app inventor online.
Make a aia in appinventor with some blocks and after exporting, open it with WinRar and change a SimpleProperty's property_name from .bky file. Save it and import it in appinventor
Thanks, I have 157 orphans in my project but all components exists. For example, it is showing a "Visible" block of "VerticalArrangement" component as Orphan.