The blocks area did not load properly. Changes to the blocks for screen 5475942398296064_menu will not be saved

Hi All,

My project was working file just two days ago. But today when Iopen blocks i am getting below error ,

The blocks area did not load properly. Changes to the blocks for screen 5475942398296064_menu will not be saved.

it will be great help,if someone can find solution for this.
e_turizm.aia (3.1 MB)

Your travel brochure app ran into blocks loading errors in the menu screen, when I tried to browse it on the code.appinventor.mit.edu server

I used the Unchive utility to browse that screen's blocks, and I found you had been using a rubber stamp in the Blocks Editor instead of loading your data from tables.

A specialist may be needed to correct this .aia file.

I hope you have earlier exports.

P.S. Here is a sample of table-based tourism ...

Here you go e_turizm.aia (3.2 MB)

Block was available but not the extension

Thank you Boban

good luck with your work

@ewpatton Is there a more graceful way to handle or prevent orphan extension blocks from crashing a screen load?

Is this on the bug list?

@Boban How do you spot an orphan extension block in a sea of XML?

@ABG

First, import the corrupted project into App Inventor, and then find the corrupted block. In this case, it's the small grey block here.

image

Then, unzip the AIA (on Windows, simply rename it from abc.aia to abc.zip, and then unzip), open the /src/ folder, and go all the way to the file menu.bky.

Then, use Ctrl + F, search for these two XML strings:

  • method_name

  • event_name

Go through those with the search tool. When I inspect the 42nd event_name, I found this odd block.

It says that there is a FingerprintSensor component (extension) here, but it does not exist in the project. So I went ahead and deleted it, starting from <block type.

Done. Put the edited XML back, zip the folder, and done! (no more errors)

1 Like

It looks like this can be done by program, maybe some one can make one, easy to check the error and fix it automatically.

Try the above metod with this project FailProject1.aia (1.7 KB)

P.S. it's a small one

In this case, my method does not work since there is no "extremely corrupted" block. However, the Label setter does not show an X (it should).

image

There is a small typo in HeightPeercent. Changed it, working fine.

My way of doing it

Notepad++
Install xml plugin

7Zip (no need to rename aia to zip etc)

Loading the project in MIT
Check count of blocks for the affected screen
Check count of <block in *.bky file

Search for in this case for block 4977 (this is where the first issue starts and it might be more)

^(.*?<block ){4977}\K

And as mention above

And you are done..

Edited,
Knowing that it is an extension that is missing then we can follow this

3 Likes

(added to FAQ)

(added to FAQ)

Lacking the patience to dig through huge .bky files for lucky finds, I coded a program to compare a screen's component types and names against the blocks that try to reference those names and types.

I did it in Ai2.

Here is a demo...

Import this AI2 Project:
blocks_repair_kit.aia (140.6 KB)

and open it in the Designer, where you can import into its Media Folder:

Using 7zip, open your broken .aia Project, and dive down to its src directory, all the way down, until you see pairs of .bky and .scm files.
Extract the .bky and .scm files for the problematic screen(s).
Upload them into the tool's Media Folder.
(The Designer shot above has two files uploaded in my testing, for screen 'menu'.)

Connect the tool to the Companion:
Screenshot 2023-06-12 112549

Hit the Import Screen List Picker to select a .scm file from the Media (Assets) Folder
Screenshot 2023-06-12 112812

The app will load both the .scm and .bky files.
Depending on the gluttony of the patient, this might take a moment or three.

Now you know what to look for when you break out your XML Editor for your surgery on the .aia file.

I also threw in a List Picker to show all the screen components:

blocks_repair_kit.aia (140.6 KB)

Please pardon the pretentious project name.
I had hopes to attempt .bky repair inside the app, but discovered that is best left to a good XML editor.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.