Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by silviu-georgian77 · Aug 30, 2021 at 05:01 PM · iosquitrestart gameresumeforce stop

[iOS] Foce quit, then reopen => 10 seconds freeze, then app restarts

Hello I encountered this strange behaviour that happens only on iOS.

1. Open game

2. At any point force close it (Swipe up where all the last opened apps are shown, then swipe up on my app to remove it from the list)

3. Then re-enter the game


Expected: The game should relaunch normally, starting from the splash screen

Actual: I see the last frame before I paused the app before force quitting for about 10 seconds. I think the game settles some undone tasks from the last session, but I cannot be sure.

Then the game acts normally and starts from the splash screen.


Extra info: If I install from TestFlight, when re-entering the app, it crashes. There is another scenario. If I just force close the app, then wait 10 seconds, I get a crash. Again, this only happens with TestFlight. It is very similar to this: https://answers.unity.com/questions/1722813/unity-20192-ios-build-crashes-5-seconds-after-the.html Anyway, the workaround with the post build script does not work.


Noteworthy plugins I am using:

  • Admob (but the problem happened before installing it)

  • Sprite Skin + Animation 2D (these has caused me many problems, but problem happens even if I force quit in scenes where I don't use it)


This is what I get when quitting: That Enlighten thread might be the culprit, but I have already disable everything light related.

 -> applicationDidEnterBackground()
 -> applicationWillTerminate()
 Quitting
 MainScreenManager:OnApplicationQuit()
 
 Setting up 1 worker threads for Enlighten.
   Thread -> id: 16cbcb000 -> priority: 1 
 Message from debugger: Terminated due to signal 9


My main questions would be:

1. Why does the app hang on the last frame, even if it has been closed manually by the user?

2. I am not making any web calls in OnApplicationPause. What else could make the app execute some work to be done after force quitting? Already checked my own OnApplicationPause and OnApplicationFocus and they do trivial stuff like removing listeners from a list.

3. I have a threading solution that waits for tasks in an infinite loop on a separate thread. While it has nothing to execute, I do a Monitor.Wait(tasks) inside the infinite loop, so the thread actually sleeps. Could this cause any problems?

Thanks for reading

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by silviu-georgian77 · Aug 30, 2021 at 07:58 PM

Found the problem. It had to do with a couple of worker threads that I was spawning. In C# we have Thread.IsBackground which I had to set to true. If it is false, the system thinks that they are foreground threads and will wait until they complete. The iOS system gives them about 10 seconds to complete after you force close the app. If you set Thread.IsBackground to true, the app closes immediately.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

196 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Restart the application 0 Answers

Application.Quit() won't work on iOS and screen does not auto lock while inactive 0 Answers

IOS Achievement : load fail but load descriptions succeed 1 Answer

How to pass a float value from another script? 1 Answer

Updated Accelerometer Calibration Solutions? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges