10880 block limit exceeded - compiler error DX execution failed

Hi, I have a project with one screen and 10880 blocks (apk size is 6.4MB) but as soon as I add more blocks to the project, I'm
getting an error while compiling "Yail compiler - DX execution fail" (see screenshot below).
To have the ability to add more blocks and not get this error, I'm forced to delete blocks somewhere (it's not important where and which - important to go below the limit of 10880 blocks).
Is this 10880 block limit my problem or is it already known? Maybe someone has a solution? thank you!

You could try compiling on the code server, in case it is a timeout issue ? Make a copy of your project first, and don't mix the two up.

When you have too many blocks spread out over too large a surface area,
the Blocks Editor hits a complexity limit when it tries to generate a blocks.png file for the screen.

There are two main approaches to deal with this:

  • Start a Google Doc with a Table of Contents explaining your app, with sections for Design, Data, Code, including Downloaded Png images of all Events, Procedures, Globals, and with html cross-links for easy navigation. Such a doc becomes easier to read than a complete blocks image, because you have FIND, Next, PREV, back functionality, and you can add paragraphs of commentary around your code. This is my preferred life saver when doing a very large complex app. If you go this route, try to arrange your blocks geographically in a column matching the order of your Table of Contents, then do periodic Clean Up Blocks to pull them inline. This sometimes lowers the load on the Blocks Editor.
  • Reduce your block count:
    • Use parametrized procedures for common code
    • Use Media text files instead of big clumps of text blocks
    • Use generic blocks instead of repeating component event blocks
    • Encode repeating decision patterns into lookup tables loaded from Media csv text files (does your blocks image look like a box of combs?)
1 Like

Hi TIMA2

  • Unfortunately I don't know is it time out issue or not but the error message is not telling anything about timeout.
  • I'm using the " build..apk" option and I was absolutely sure that the compiling process is done on server. If I'm wrong - could you please tell what is necessary to do in order to execute this process on server?
  • I used to do always checkpoints and Aia downloading - could you please explain what does it mean - "don't mix the two up"?
    Thank you
    Alex
  1. Export your project to an aia file.Make a copy for back up of this file.
  2. Go to the code server: MIT App Inventor
  3. Sign in with your preferred method
  4. Import your aia project
  5. Attempt to build an apk
1 Like

Hi ABG,

  • I have many blocks but they are all condensed into events and procedures and the whole project is fit/inside my monitor screen. Also the error doesn't appear when I'm increasing the number of procedures (condensed) but the number of blocks within the procedures. That's why it seems that the surface area size is not the source of this error.
  • I've been coding and writing technical tasks for other programmers just the last 40+ years (I'm a retired old programmer who now helps my community for free) and I've had my own approach in this area from the time I was writing code in Assembler.
    But obviously it is possible to optimize the structure and the code and that is exactly what I am doing now by reducing the number of blocks.
    But I was looking for a different solution: Is it possible to get rid of or work around this 10880 block limit?
    Thank you very much
    Alex

You might also read this:

https://groups.google.com/g/mitappinventortest/c/Wfe6Jb8D0fk/m/JzI_OvO0BwAJ

Thank you for the new compiling environment!
Unfortunately the error persists. But now there is an additional message:
"Build failed. Error. Your build failed due to an error in the DX stage, not because of an error in your program"
And its written also:
DX time: 56,35 seconds

Maybe you was write with a timeout?

Do you have many images / other files in your assets (media folder) ?
What size are each of the files ?
Are the image dimensions appropriate for your target device ? (e.g. for an average phone, no bigger than 900x400 pixels (for a full screen image))

The biggest file i have in assets is SQLight DB of 1 MB. All other files are icons (60x60 px) and CSV file with all texts and labels (less than 1MB). The total dimension of APK is 6,4 MB

Any red or yellow errors?

image

What extensions are you using ?

From this thread it seems like my about 11000 blocks is already a record :sweat_smile: and the only real fix is to change the compiler (actually I have android studio but I don't really like the idea of rewriting all 11000 blocks)

No warnings or errors

A lot of extentions. But the problem is appearing as soon as the total number of blocks is exceding 10880 and i dont think that the problem is connected with extensions

We usually say "you have too much of something", it may appear obvious that it is the blocks, and it probably is, but it does seem you have "excessed" elsewhere too.

Does it all have to be in one app? Could you split it into two apps and link them together with activityStarter?

I get the jitters if my block count goes anywhere near 4000, and even that is a rare thing...., or if I have more than three extensions....these things tell me I need to revisit my approach and do things differently.

I counted now - there are 23 extensions! And it's not easy to break the functionality into a few apps.
Surely 11000 blocks is too much for the AI.
Thanks a lot in any case.
I'll try my best to reduce the number of blocks and maybe rewrite parts of the largest procedures in java scripts or creating an extension.

You've exceeded even the code server's capacity.

I recommend exporting individual images of procedures and events, using the Ai2Helper browser extension from

You will get a finer grain of backup that way, since the downloaded blocks images can be dragged into new projects' blocks editor workspaces.

The operation can be done in bulk, into a single .zip archive.

If you post the largest item in that .zip archive, it might spur discussion of ways to reduce block count.

Regarding the build errors, here is my collection of collections of build error types:

This online Unchive tool can post summaries of uploaded .aia files.

Unchive

You can also download .AIV summaries for others to study without giving away the .aia export.

Try compiling the project on the server:

https://code.appinventor.mit.edu/