Installed APK starts, immediately crashes, but second start works!?

Hi all! :smiley:

When I press an installed APK app icon on two different phones, it flashes the app screen very, very quickly and returns to the phone desktop. :expressionless: So I press it a second time and it runs OK. I exit the app and press the icon and I get the same “flash” and program closes. I press the icon again and the app starts up just fine. :unamused:

As always, any help is greatly appreciated! :grin:

Is this app related to the thread you had trouble downloading, if so then there is something still wrong with it…

1 Like

Different problem. The behavior is the same on my S8 which has no problems downloading my app. This particular problem has been happening for several iterations of my app, the download error just started today on my S9 only.

Can you send an APK, maybe someone can get logs for you?

Show the blocks of the Screen.Initialize event.

Thanks for everyone’s replies. :smiley:

I haven’t paid attention to how one obtains logs. :smirk:

I have attached the .apk and the .aia of a test program that displays the problem. I tracked down the problem to the open screen functions.
:astonished:

Here are the blocks:
Screenshot from 2020-11-13 18-53-40

This test project is a “new” project and it does the same thing. Wierd.
:thinking:

ScreenTest.aia (2.9 KB)
ScreenTest.apk (5.2 MB)

You’re switching screens incorrectly. What’s happening is it’s on Screen1 so when you close the screen, it’s not actually crashing, just closing the app. It’s just unable to open a new screen because the app is already closed.

There are two ways to solve this:

The problem you had can be explained like this:
After Screen2 has been opened, Screen1 is closed. If the app is now closed (button → close application), Screen2 is closed and it also tries to close the main screen (Screen1). Since this has already been closed, the task remains in the background and will then be executed the next time the app is started. Therefore, the app will be closed immediately the next time it is started (Screen1 closed).

1 Like

Thank-you for your replies, they are appreciated. :wink:

Hmm. :thinking: When I started using Kodular a few months ago, I was using the first blocks in the following image to change screens:

Screenshot from 2020-11-14 12-43-10

But I had problems switching between screens, so Boban suggested using the third set of blocks in the image. Open Another Screen block Not working - #11 by TwoCanes_LLC

But what works for me now is to pretty much go back to the original method surrounded by a procedure, ie, the middle blocks in the image. :grin:

So my question is when would I ever use the third set of blocks? Why would I close the first screen when opening a second screen if it doesn’t really close until you go back to the first screen? Sorry to be so obtuse, but it’d be nice to understand this issue. :crazy_face:

never… to switch screens in Kodular, which works for all components follow this recommendation

important is to first open the new screen, then close the current…
Taifun

Got it. Thanks for your help.

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