Compilation error. Help :((

App Inventor не может скомпилировать проект. Â
Ошибка:
________Preparing application icon
________Creating animation xml
________Creating style xml
________Creating provider_path xml
________Creating network_security_config xml
________Generating adaptive icon file
________Generating round adaptive icon file
________Generating adaptive icon background file
________Generating manifest file
________Attaching native libraries
________Attaching Android Archive (AAR) libraries
________Attaching component assets
________Invoking AAPT
AAPT time: 1.345 seconds
________Compiling source files
(compiling appinventor/ai_lifefive3/NanoComfort/Start.yail to appinventor.ai_lifefive3.NanoComfort.Start)
(compiling appinventor/ai_lifefive3/NanoComfort/Screen1.yail to appinventor.ai_lifefive3.NanoComfort.Screen1)
(compiling appinventor/ai_lifefive3/NanoComfort/Lock.yail to appinventor.ai_lifefive3.NanoComfort.Lock)
(compiling appinventor/ai_lifefive3/NanoComfort/Stop.yail to appinventor.ai_lifefive3.NanoComfort.Stop)
(compiling appinventor/ai_lifefive3/NanoComfort/Open.yail to appinventor.ai_lifefive3.NanoComfort.Open)
(compiling /tmp/runtime404299570196037392.scm to com.google.youngandroid.runtime)
Kawa compile time: 6.844 seconds
________Invoking DX
DX time: 51.430000 seconds
YAIL compiler - DX execution failed.

Please, is there a solution to my problem. Recently, when compiling, I began to receive this message. Empirically, I determined that this error is due to the large number of blocks. As soon as I disable or remove some of the blocks, the compilation succeeds.
I have a large application, 10800 blocks. But before it was 12000. I have already removed and optimized all the blocks that I could. Now I can't compile apk until I remove 50-100 blocks. And accordingly, I can no longer expand the functions of the application :disappointed_relieved:
Is there any workaround for this limitation, please help who can. THANK YOU

This is the problem. You never need so many blocks; the average user never exceeds 2,000. You can try using the following methods to optimize your code.

  • Lists and for each loops. Instead of doing something every single time, why not try loops that does one thing for every component?

  • Procedures. Do you have parts in your code where you repeat things?

  • Split one screen into two screens if you think it is necessary.

1 Like

Unfortunately, I have already defined all the recurring operations in lists and procedures, and saved almost 2000 blocks. But the rest of the blocks are also large (((May have to think about increasing the number of screens

You could upload your Project File here for the Power Users to take a look:

Export Project

UploadToTopic

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?)
2 Likes

Unfortunately, I did not quite understand you about the Google document. I think this is because of the translator (( But I think this is something quite useful. Could you show some examples in the form of screenshots? Thanks.

The Google document is a coping mechanism to aid in Blocks Editor navigation, and for explaining the overall organization of the app and its parts.

Board tutorials are more translator-friendly, like in

My docs are indexed at

See the Browser extensions section of

for navigation help in the Blocks Editor.

Further advice:

If your component or block count increases as your data increases, you are doing it wrong.

1 Like