Skip to first unread message

Valerie Armstrong

unread,
Jan 31, 2019, 4:32:46 PM1/31/19
to MIT App Inventor Forum
Hello,

I have a group of students who made a great little origami tutorial app. Unfortunately, we can't export it. All of their other apps export fine, but when we go to export the origami app, it just waits and waits for the MIT server. We never even get an error message, and there are no notices of popups. The option to save the apk (or get a QR code for it) is greyed out, so that's not an option either. I'm stumped. Is there anything else I can check? It is a large app with many photos and too many screens. (We haven't worked much on flexible screen design yet.) Has anyone eles ever seen this issue before? Do you have any suggestions for what else I can check? I really want the kids to be able to share and package their app.


SteveJG

unread,
Jan 31, 2019, 4:46:27 PM1/31/19
to MIT App Inventor Forum
How large is the Project aia Valerie.  If it is large than 10 Mb, you have found the culprit.   How many Screens?   Apps with over 10 screens become unstable or impossible to compile.

see the following general tips and in your case especially #1 and #2

  1. Use different screens wisely
    Before starting to create another screen, first you should think about is it really necessary? See also Building apps with many screens and SteveJG's post about advantages/disadvantagesbecause in only one screen you also can use vertical arrangements to simulate different screens, just set the arrangements to visible = true/false as needed... See also Martyn_HK's example about how to use Tabs in App Inventor and another example from Cyd

    If you decided to use different screens, then you should switch them correctly, else you will run out of memory after a while...      
    The recommended method of switching screens in App Inventor

  2. App Inventor works best if you use images whose size matches the size you want them to appear on your screen. If you import larger images into your app, your app may run out of system memory. Using Images with App Inventor

    by Italo: First, you need to understand that the file size of an image is not the amount of memory it uses when it's being displayed. The file size is the compressed size, much like a zip or rar file. When viewed, the image needs to be decompressed.
    For example, if your image says its file size is 100 kb, and its dimensions are 1024 x 768, 32 bit color, then that image uses over 3 mb of RAM (not 100 kb!) when you show it on the screen. ((1024 * 768 ) * 32) / 8 = 3,145,728 kb (3 mb)
    Now, this is a mistake most people make when using arrangements as "virtual screens": They set different image components with their images loaded but hidden, instead of having only one image component and changing the picture according to the user's selection or app events, not knowing that apparently the hidden image components are also using the ram, (yes, even though they are invisible!).

  3. Avoid redundancy
    Probably it helps to read chapter 19 - 21 in Dave's book http://www.appinventor.org/book2 to get an idea how to do DRY programming with App Inventor - Don't repeat yourself 

  4. See SteveJG's monster list of tips and tricks

  5. How to overcome the App Inventor project limit of 10 MB

  6. Backup your project frequently
After you fix some things, you might try to compile on the Amazon server.   It is more forgiving.  The main server times out after 60 seconds of attempting to compile monster apps.  Try the server at  code.appinventor.mit.edu   you will have to import the Project aia.   Make sure you enter a 'revisit' code ...this server does not require your  usual log in credentials but you must assign a password or will not be able to return to change the Project.

Anything here help?

Regards,
Steve

TimAI2

unread,
Jan 31, 2019, 4:48:07 PM1/31/19
to MIT App Inventor Forum
You have identified your two issues:

1. Too many screens (how many?) More than 10 will cause instability
2. Many photos (how large - file size, dimesions and resolution)

The latter may have taken you over the 10mb limit, the former may be causing compile problems

Can you make a copy - Projects > Save Project As... then remove all the photos. Will that version compile. If so this answers your question.

You may need to resize all the images to match the screen size of the device/s you are using
You may need to look at how you are using screens and switching between them
Also check for "spare blocks" and errors

Please read the following about screens and screen management and also follow the links on Using Images

Use different screens wisely

If you decided to use different screens, then you should switch them correctly, else you will run out of memory after a while...      
The recommended method of switching screens in App Inventor
(Thanks Taifun)

Also see demo: multiscreen.aia

If you haven't done it already....

Reply all
Reply to author
Forward
0 new messages