App Inventor Mobile App Crashing

Hi,

My App Inventor Mobile App keeps crashing when I try to launch it. I'm making an app where the user can add markers to a map. What's in my code that's causing the issue?

Thanks!

To properly take a screenshot of your blocks in high quality, please right-click an empty space in your workspace and select "Download blocks as Image".

However, there might be something wrong here.

You have a long or statement. To create new sockets, click on the blue cogwheel and drag little "boolean" blocks to the "or" block, like this.

AddInputs

Hello Aiji

When you try to launch the App? Is this in the Emulator, or on your phone via the Companion or as an APK?

If it's on your phone, a launch crash is often caused by Android not being able to deal with your images, from the App Icon to any image within the App.

Go through my check list here:
ProfessorCad: Tips & Tricks Cannot Build/Install/Run APK

Hi Chris,

I'm launching the app via the Companion. I know the problem is with my code because when I launch the app when I'm on another screen, it works, but when I launch it on this screen, it crashes.

Thank you! I just altered my code to create a better or statement. However, it's still crashing. Do you know what else might be causing this?

Thank you!

Take everything out of your Screen1.Initialise event.

Does it still crash when you load this to companion ?

If not, then start adding items back one by one, and test again, until it does crash, then you will find the culprit.

If it still crashes with an empty Screen1.Initialise, then there is a blocks/component issue somewhere.

You do not appear to be showing all the blocks on your screen. Use the right click menu to organise your blocks and then download all the blocks as an image to post here.

3 Likes

The "add items to list" blocks in Screen Initialize should not be there - you don't need to add in this way, just include them via "make a list"

Also you should not create a List for the List Picker in Screen Initialize, again that can be a pre-defined List.

Snap041

2 Likes

Thank you so much! I took all of your advice, and this is what my code looks like now. When I tried to debug the code by taking everything out of Screen Initialize, it still crashed. I'm going to try your debugging strategy for the other parts of my code, but in the meantime, here is a picture of all of my blocks:

Aiji

Can you upload your Project File for a Power User to test?

Yes! Here it is.
TechnovationProjectV2.aia (3.0 MB)

Hi

Well, all of your button images (clickable images used as buttons) are far too big, dimensions and file size. They should be reduced dimensionally to the final size (28 pix * 28 pix). Also, do not compress the images - Android has to decompress them to display. I recommend using webp format, it is similar to png in quality but has a smaller file size.

You can use a free image tool to adjust the images. My favourite is IrfanView.

A 28 * 28 pixel area is not easy to tap! You could make your App Fat Finger Friendly by increasing the size to 44 pix, using a Horizontal Scroll Arrangement to ensure accessibility.

https://www.professorcad.co.uk/appinventortips#TipsImages
https://www.professorcad.co.uk/appinventortips#TipsGui