Function: Quit the game

I compile the project through the website cocoon.io Run the game on your phone, press: Exit the game. The game freezes and will not turn off. What to do? Also samoeproiskhodit when testing the game through the site

Give an example of the code who works