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

Hello!

In the process of testing my application, I encountered an unpleasant situation.

I’m testing the application on a real device (Android 6.0 / 7.0).

For unknown reasons, at different times, the application is restarted.

That is literally - it is restarted. It’s not crash.

Identify the sequence of actions leading to a restart did not work, because each time it happened at different times. Sometimes it was enough to launch the application (this is a game), take several actions without starting the game. Sometimes it happened during the game.

In some cases, access to the Internet was, in some cases - no.

The application uses:

  • Google Play Game Services plugin (plugin.gpgs)

  • Google IAP pluggin (plugin.google.iap.v3)

  • Firebase plugin (plugin.firebaseAnalytics)

  • Appodeal plugin (plugin.appodeal)

I do not even know what to do with these restartings.

If someone has come across a similar or there is an assumption - help please advice! Thank you!

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

  1. No.

  2. No. What other options are possible besides re-executing? The behavior of the application during restarting indicates the repeated execution of the main.lua. As I wrote earlier - the main problem is the impossibility of reproducing the restart on demand.

  3. Corona SDK build 2017.3184 (macOS)

Testing showed that the reboot occurs at times when the phone loses the network of the cellular operator or when it finds it and connects.

I will check the network services (Firebase, Appodeal, GPGS, Google IAP).

Hello everyone!!!

I continued to investigate this problem. The conclusion is disappointing - this is the problem of the Corona SDK.

I disabled ALL network services, ALL additional modules - the problem is present.

Next, I took the prototype of my game, there are 10-15 lines of code, not a single additional module. The problem is present.

I specify the essence of the problem:

Android (iOS not tested yet). The application is restarted. I play, I’m just in the menu - it does not matter. At some point, I again see a Corona splashscreen, and the application is restarted.

Reason for restart - the phone is losing its cellular network.

The application itself restarts at the moment when the indication of the status of the cellular network changes from “No service” to “Emergency calls only”. And this behavior of the phone (not the app) is absolutely normal, for example, in the subway.

Question to the Corona Stuff.

What are the solutions to this problem?

I fail to see any proof in that last post that Corona is the issue.

Correlation is not causation.

How many devices have you reproduced the issue on? Are you sure your device isn’t having some kind of issue?

Last, if you can come up with a recipe to reproduce this, you probably need to file a formal bug report with a zipped project and numbered steps to reproduce.

I will be glad to be wrong with my conclusions on this situation, however, in my opinion, for now everything points to the problem with the Corona SDK.

Right now, I’ve done these steps:

  1. Launch Corona Simulator

  2. Create new project, template - Game

  3. Make APK and install it on my android device.

4. Verified that the cellular network is working

  1. I started the application and waited a while.

  2. I went into the settings of the Android, turned on the mode of the cellular network 2G (my operator in my region does not work at frequencies of 2G. Accordingly, the inclusion of this mode completely simulates the mode of signal loss).

  3. Returned to the application.

  4. After a while it restarted itself.

What then is the problem, if not in the Corona SDK?

And, have you tried these same steps, but running some several other games and apps not made with Corona?  If so, do they all stay running and none of them restarts?

As far as your last question, the problem could be anything in a long list of issues.  That definitely doesn’t narrow it down to Corona.  You could be tripping over a OS bug, or an issue with that model of phone. 

I didn’t see an answer to the question, “Have your reproduced this on any other devices?”  Perhaps, a friends device?

Are you running a live build or an actual install?

Before you built to install, did you make sure to delete the live build file from the root folder? 

  1. This issue is repeated not only on the specified test device, but also on two other devices (phone and tablet Xiaomi, OS version 6.0, 7.0).

  2. Just tried to reproduce this issue with Knife Hit game by Ketchapp. Everything is Ok, no issue there.

  3. Actual install (copy app to phone, install; Google Play install).

Can you please install this tiny app and see if you can reproduce the issue:

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2018/04/basic.apk

Source (but please run the one I built):

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2018/04/basic.zip

For understanding:

The cellular network goes from the “Working” state to the “No service” state first. There is no problem at these two stages.

But it is worth the cellular network to go into the state of “Emergency call only” - it takes several seconds and the application is restarted.

Google play install?  I suggest simply installing the app directly for testing.