App Crashes on start

I am creating an offline wallpaper app. I have added upto 50 images.
The app code is really simple. On my phone ( tested on multiple phones ) The app crashes.
I found out that the app crashed because i had the option of load high quality images in screen 1 enabled. without this option the app runs fine but the images that are loading are blurred.
Can anyone please give me a solution of how to fix this.
the images that i have in assets are .png and .jpg
A solution will be highly appreciated. Thanks.

Edits: The app is working fine on android 8+.
Is is only crashing on android 7 and below.

Instead of storing images in assets, store them in online cloud storage, and call them using firebase database.

This will make your app light weight and runs smoother and it will not crash.

  • When does the app crash? (At the first run?)
  • How many images are loaded / shown at Screen.Initialize at the same time?
  • What size / dimensions are the images?
  • Post screenshots of Screen1 and / or the APK / AIA.

Yeah Bu i want to make it offline so that the user can use it even if he/she is out if internet.

Then you will face many problems when you use large assets.

It loads perfect on android 8+. The problem is only for android 7-.

  1. The app crashes on first run.
  2. no image loads.
  3. the minimum dimension is 168300 and Max is 10801920
    and the minimum size is 9kb and max size is 2mb.
  4. screenshots are below: Plus i have also attached the aia file:
    DBZ_50walls_1.aia - Google Drive

But there should be some solution.
Because i have used other editors and there was no such problem there.

first of all you are not switching screens properly, you just open screen for button click but never close it, for that check out this guide: How to switch screens correctly

second, try to use dynamic image component to create dynamic images and set their images from assets, and i will highly recommend to call procedure Asynchronously using image utilities,

try this and mention if it helps

I have added “open other screen with start value” on the click of image… Is it correct? or should i make buttons and add images on the button? Please guide me.

if you want to open screen with start value:
procedures_callnoreturn open

use these block and when image/button click call “SwitchScreen” and pass screen name and start value

Switching screen might not be the (primary problem)
grafik
but the dimensions / sizes. See e.g. here:

So reduce your images to the dimensions actually required (on Screen1: 178x96 px) and load them into the required dimensions on the “wallScreen” screen.

And consider whether it is necessary to load / display all images at the same time on Screen1.Initialize.

exactly it is not, i just wanted to share a good habit of switching screens :slightly_smiling_face:

1 Like

Yes I will follow your guide thank you.

For that i have to upload multiple images right? Or can i use different dimensions of one image in different parts of the app.
If i can then what is the process to change dimensions of image and use it?
Thanks.

u can do it manually by many editors but if you are in search of extension than
https://puravidaapps.com/image.php
its better to edit images manually and than upload in assets or anywhere you upload

1 Like

So i have to upload multiple images 1 with less dimensions and the other with original dimensions?
It will increase the app size. right?

nope, do you have limited images? if yes than dont load all the images instantly as screen1 initializes but use timer to load images in steps

Kodular app size is limited. If you store more images then the app will definitely crash. So first build the app without the images from kodular and later on insert images on the app by decoding it using external softwares like apkstudio.

I’ll give it a try

Just as an example: if I adjust the original size to the required one:

grafik

So there should be no problem with the app size if all images are adjusted to the correct sizes and formats.

2 Likes