AI2 Companion Keeps Stopping with App

In 'Alerts' screen, the companion keeps stopping. If I initialize the companion in the screen, 'label6' becomes visible, but if I open the screen from 'Screen1', it closes itself. How can I fix this?
Weather.aia (1011.2 KB)

Also sorry for the 1,600 blocks :grinning_face_with_smiling_eyes:.

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

Okay, so in other words I have too much code and I should reduce the amount of blocks I have?
Will too many code blocks affect my built .apk file?

resize your image assets to a small one.
One icon no need with dimension 1000*1000.

2 Likes

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