Why does my app crash?


Ok, so I have an app that has 25 buttons in the home screen. When you click on one of those buttons (button No1 - button No25) it retrieves an image URL from firebase and opens another screen which shows the image.

When I open the app it normally displays the splash screen (screen1) and after 2 seconds the screen1 closes and a screen called “Home” opens. If I stay idle it wont crash, but if i open another screen, even if i immediately close it, it crashes sooner or later.

Does anyone have a clue on what might be the cause of that?


You forgot to include a screenshot of your blocks. Without it we can’t possibly know what’s wrong with your code.


my guess is, you are switching screens not correctly, see tip 1 here, how to do it…



Well, the app’s blocks are a lot. I think more than 1k. I will try to find a solution and if it doesn’t work I will try to show you screenshots


I don’t think there is a problem with the screens. In an older version of the app the crashing issue didn’t exist. The things that changed are:

-Switched from fusion tables to firebase
-Added FABs (even with one FAB only, it crashes)
-Replaced a button that opened a screen with the FABs


You say your app crashes when you change screens, so post the blocks that you use to change screens only.
Also if you didn’t, read the post @Taifun gave you. Most of the times it solves the problems with many screens.


use logcat to find out more about the runtime error



This is how I open the screen called “More” from the main screen (“Home”)

This is how I close both the “More” and “Base” screens (by clicking a button which says “Back”)

And this is how I open screen “Base” from screen “Home”


those blocks look fine,
you might want to use logcat now…



So the only thing I need to install is the app Inventor software? If so then I’ll try it out and let you know if I come across any issues


I connected my phone via USB but in the cmd it says:

  • waiting for device -

EDIT: it found my device but I think I might be doing something wrong


Could my app crash because I use many high quality images?


Probably yes, what are your sizes of your images in px…


They vary, but the maximum width is 555px and height 375 and I have 19 of them.


Depending on how you use these images for me it sounds too big.

  • all images at once
  • on screen size fixed or responsive
  • how much of the screen does the image take

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!).

do you have any screenshots of your app so we can see what it looks like.


That post by @Italo helped actually. I read about setting images to invisible and setting them to none and I experimented in my app. After a while I found out that I had a web viewer inside an arrangement and instead of setting the viewer to (in)visible I only did that with the arrangement. For now the crash problem is fixed. :smiley:


It would be great if you mark it as solved then…

split this topic #18

A post was split to a new topic: Help with Account Manager extension please