The application restarts during execution (on real device, not emulator)

Stepping away for a bit.  Back later.  Sorry, in the middle of some things over here.

This problem first appeared when installing the application via Google Play (alpha version of the application).

Later I tried direct install ofc.

I thought I responded to this earlier today… Lots of weekend distractions for me…

Anyway, I think @roaminggamer asked all the relevant questions, but I would like to point out your test is causing the app to suspend and resume. I don’t know if that’s impacting anything you are doing. Since you seem to have a test case, zip that up and share it with the community so you can get some additional device testing.

Now I remember, you also submitted this to support and that’s where I responded. 

Rob, I already sent you the archive by e-mail.

And in addition - the error was repeated when creating an empty project (template Game), without a single line of code from me.

My test is causing the app to suspend and resume only because I can’t go to subway every time I need to test)))

And my test case completely simulates the behavior of the cellular network in the subway.

With the exception of moving the app to background and resume.

roaminggamer, same issue with your app.

For the first time I found this issue in the subway.

In further trips, I observed the behavior of the phone during the occurrence of this problem. And I found (and later confirmed) that this happens precisely when the state of the cellular network changes to “Emergency calls only”.

@a.voitov,

re: Same failure.  Excellent.  Thanks.

Rob already chimed in, but can you list the exact devices + models you’ve tested on and include their exact OS versions too.

  • Xiaomi Phone ??? model  Android ??? (include whole version number not just major number)
  • Xiaomi Tablet ??? model  Android ??? (include whole version number not just major number)

(Ex: 4.0 is a major number, but 4.42.3 would be an entire version number.)

Thanks

@everyone,

  1. Please download the APK I supplied (since it reproduces the problem) or if a.voitov supplies one try it.

  2. If you can, please see if you can reproduce this too.

PS - I don’t have a cellular android device or I too would contribute to this testing. :frowning:

@roaminggamer

  1. Huawei SLA-L22 (Huawei Nova Lite 2017), EMUI 5.1.1, Android 7.0

  2. Xiaomi Redmi Pro, MIUI 8, Android 6.0

  3. Xiaomi MediaPad M3 Lite 10, EMUI 5.1, Android 7.0

@everyone

I reproduced this issue (as I wrote earlier here) with new (just created) project, template Game, too.

I should be near my Android tablet later today (Nexus 9, Android 7.xx) and I’ll give it a try, though I don’t now that it has cellular service so it may a moot test.

Rob

Thank you, Rob.

In my case this issue reproduces only with cellular network. And only when “Emergency calls only” status appears.

Two or three times it was possible to reproduce this problem by switching the phone to airplane mode. But this is a very rare case. I was able to reproduce this problem by the method described above.

FWIW: I constantly test my games in aeroplane mode (to simulate lost internet connection) and no restarts occur.

@Sphere Game Studios

Thank you for participation!

Switching to aircraft mode causes this problem very rarely (~ 0.5% of cases).

This problem is reproduced when the cellular network is switched from “No service” to “Emergency calls only”.

Reduce and simplify the app and what it is doing till it stops crashing/rebooting, then slowly add features back in.

When you get a crash/restart in the ramp up phase, note what you changed and debug accordingly.

First pass would be to remove or disable all external code you can. i.e. ads, etc.

Personally, I have never seen an app “restart”.  In fact there is no mechanism - AFAIK - to achieve this in Corona.

Do you mean the app actually stops and main.lua is reprocessed?  More info is definitely required to debug this.

If you are using composer API it may be you are hitting a memory limitation and your scene is being automatically purged - so check for memory leaks.

As Rg points out you will need to reduce this to its most basic form.

 Hello and thank you for reply!

It was on this path that I decided to go. I hope to find a solution.

Hello and thank you for reply!

  1. You are right - I use composer API and about app reload - app stops and main.lua is reprocessed.

  2. Do you know the specific memory limitations?

  3. I was looking for a memory leak but could not find something specific. Texture memory is used at the level of 15-21 megabytes. System memory - in the range of 600kb - 1500kb.

4. Do you think that the restart of the scene can be connected to network activity? Can it be caused by the loss of the network of the cellular operator? I’m trying to sort through all the possible options. The problem is that restarting the main.lua is extremely difficult to repeat. The application can work long enough, with a good load. I have not yet been able to establish an algorithm at which the main.lua reprocess would occur.

Anyway, thank you for your help!

How do you know main.lua is being reprocessed? 

Are you using Live Builds?

Rob

Hello Rob and thank you for reply!

About reprocessing - it’s my guess, based on previous replies and:

  1. In my app I have my own splash screen. Here is my main.lua:

[lua]


– main.lua


local composer = require(“composer”)

– Hide status bar

display.setStatusBar(display.HiddenStatusBar)

– Seed the random number generator

math.randomseed(os.time())

– Reserve channel 1 for background music

audio.reserveChannels(1)

– Reduce the overall volume of the channel

audio.setVolume(0.4, { channel=1 })

– Go to the splashscreen

composer.gotoScene(“splashScreen”)

[/lua]

  1. After splash screen is done, app goes to game.lua

  2. When these “restarts” occur the application again shows a splashScreen scene.

  3. Corona splash screen is enabled, but not shown during “restart”

P.S.

I do not use Live Builds.

Could you have other code calling composer.gotoScene(“splashScreen”)?

Have you tried to put in some print statements to see if it’s really re-executing?

What version of Corona are you running against?

Rob