Appodeal - network issue causes app to not close gracefully

Hi everyone,  :slight_smile:

The app changes screen as expected but when I press the back-key button to close the app with native.requestExit(), the app closes and after awhile the android message pops up saying the app closed unexpectedly.

This app crashing problem seems to persist when the internet is disabled. If Internet is enabled in the device the crash does not occur. It seems like there is some link to appodeal integration. Did anyone face the same problem?

I tested on android 6.0. Corona build version : 2016.2992

You don’t need to call native.requestExit() the way you show in your code.

Just make sure you return false when the back key is pressed and Corona will exit the app by default.

If you want to let the user decide to exit the app, then you can intercept the back key first and display a dialog asking the user to quit the app not not. Remember to return true in this case so Corona doesn’t exit the app.

If the user chooses to exit the app then you can call native.requestExit() in the dialog’s button handler.

@Sheekore

I had a look at the plugin code, and there was a case where a listener could be called after an exit attempt which would cause the error you are seeing. I’ll fix that in the next plugin release which will be published on Monday.

@ingemar_cl

Thank you for taking a look in the plugin code and also for the suggestion, I have removed the native.requestExit()

Hi again,

I did a build yesterday of the game, and it still shows the same error message. Was the appodeal plugin fixed and released?

Yes, it has been updated, but will require Corona build 2016.3016 or later.

Thank you it works fine now.  :slight_smile:

You don’t need to call native.requestExit() the way you show in your code.

Just make sure you return false when the back key is pressed and Corona will exit the app by default.

If you want to let the user decide to exit the app, then you can intercept the back key first and display a dialog asking the user to quit the app not not. Remember to return true in this case so Corona doesn’t exit the app.

If the user chooses to exit the app then you can call native.requestExit() in the dialog’s button handler.

@Sheekore

I had a look at the plugin code, and there was a case where a listener could be called after an exit attempt which would cause the error you are seeing. I’ll fix that in the next plugin release which will be published on Monday.

@ingemar_cl

Thank you for taking a look in the plugin code and also for the suggestion, I have removed the native.requestExit()

Hi again,

I did a build yesterday of the game, and it still shows the same error message. Was the appodeal plugin fixed and released?

Yes, it has been updated, but will require Corona build 2016.3016 or later.

Thank you it works fine now.  :slight_smile: