Where is loading blocks part is done?

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.

@ewpatton Have a look here

What is the motivation here?

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.

1 Like

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 grafik does not exist in AI2 but in AI2Offline.

And this block grafik does not exist in AI2Offline (but in AI2).

1 Like

Do you know any way to know which block is corrupting the whole project ? Yes, my project is having few extensions.

1 Like

Thanks, I will check it.

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.

1 Like

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

If you're into tool development, you can build on

1 Like

Hello, I also want to use your tool but I am unable to build the project

My tool works with the Companion.

It's not meant to be built.

1 Like

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.

That might be from failing to load the matching .scm file into the Media folder.

If that was not the case, upload your .aia export here for me to try against my tool, and mention which screen needs attention.

Can you do it in PM ? and post the results here later

Okay, on 2 conditions:

  • the project has never been worked on outside MIT AI2
  • tell me which screen has a loading problem.
1 Like