• 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 /
avatar image
Question by Pigghaj · Feb 10, 2014 at 05:11 PM · androidcrashload

Problem with terminating apps on Android

Okay, I got t$$anonymous$$s weird problem I just cant figure out.

I am developing a game for iOS and Android, and it works perfectly on iOS. It also works perfectly on my HTC and my Sony Xperia, however on my Galaxy S3 it does not.

Or well it does. It works fine UNTIL you force quit the game. After you force quit and start the app again, it loads the first scene (my menu) like it should, but when I $$anonymous$$t "new game", w$$anonymous$$ch loads the first scene in the actual game. It crashes.

The crash log gives me t$$anonymous$$s me t$$anonymous$$s: (and a lot more, but t$$anonymous$$s seems to be the key message?)

 I/DEBUG   ( 1910): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000

I dont know what it means, but general googling seems to say it's somet$$anonymous$$ng about memory, but I am pretty clueless as the what the actual problem can be, since it ONLY happens after you force quit the game, and only on one of three devices I have tested it on. It doesnt always happen either, but at least 50% of the time after a force quit, it crashes when restarting, somewhere w$$anonymous$$le loading the main game scene. It's really strange...

I am t$$anonymous$$nking somet$$anonymous$$ng weird is happening when the App is force quit? But what? And is there a way to control it?

Will running somet$$anonymous$$ng in: OnApplicationQuit() help? Or is that not called when you force quit somet$$anonymous$$ng?

I mean force quitting is the way to quit applications on Android devices isnt it? Thats what most people do? So it's probably bad if it means a crash the next time you run the game.

Have anyone experienced somet$$anonymous$$ng similar, or a similar crash log message? And have an idea what to do about it?

Thanks in advance

Comment

People who like this

0 Show 8
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
avatar image JeffreyD · Feb 10, 2014 at 05:33 PM 0
Share

Hey, I'm pretty new at this, but there are a number of developer settings on the phone that allow you to see the memory usage, etc, of the app being run. Perhaps working with those may shed some light on the problem.

Be careful though. I've done something with the settings in my phone that has rendered use of unity remote useless. So, I need to dload a full .apk to do any testing.

avatar image Pigghaj · Feb 10, 2014 at 05:40 PM 0
Share

Hey,

Yeah, that might shed some light. I actually havent investigated those options, but I am checking them out now.

Maybe it will provide some helpful insight.

It's still so strange that it only crashes after a force quit. I wish I knew what force quitting an App in Android really does. It does say "Force quitting an application may cause problems".... but I never noticed a problem in other apps when force quitting... and not on other devices either...

I am no expert on Android in general, since I am mainly an iPhone user, do you know if I should include some type of function or something so that App quits "properly", whenever a user terminates it??

avatar image JeffreyD · Feb 10, 2014 at 06:08 PM 0
Share

No I don't. I've only recently implemented the Application.Quit() on Escape key pressed. Is there a way to detect the "Force Quit" key on the phone similar to the KeyCode.Escape for a normal exit? If so we could use the same exit script and add the KeyCode."ForceQuitKey". (I think it may be the Home button.)

I'm sitting here playing with the game I've creating for the android (running on Galaxy S4). When I "force quit" the app is placed in a queue of sorts (running apps). Then If I "really" want to force quit that app I get the message your talking about ...may cause errors... So, if I don't do the second step the app is still in memory and can be run like normal when pressing the icon again. So, I'm not sure about the galaxy S3.

If found this link regarding debug on Android... http://docs.unity3d.com/Documentation/Manual/android-bugreporting.html

I know this is not helping. I'll let you know if I learn something of value.

avatar image Pigghaj · Feb 10, 2014 at 07:04 PM 0
Share

No matter if I force quit from the applications menu (where you get the warning message), or if I use an external activity monitor app to force quit, or if hold down the home button and then "swipe" the application, the error remains the same when restarting it.

So I guess no matter how you force quit it, it's handled more or less the same way, since it gives me the same error.

I've researched if it's possible to detect force quits, and it doesnt seem like it is... since it just terminates to current process without warning or calling anything.

Hm.

avatar image JeffreyD · Feb 10, 2014 at 07:05 PM 0
Share

How are you doing a force quit and more importantly why? I'm finding that there are two ways to exit an app cleanly (remove it from memory), first with code by using the Application.Quit on Escape button detected and Second, manually clear the applications loaded list on the phone.

As you know, when the user presses the home button (Bottom center) to exit the game/app and returns to their "home screen", the app is still in memory. The user can then either restart the game from the list of apps in memory (Press-hold the Home key to get the list) or they can restart the game by pressing the app Icon. If they restart the app that is already in memory then note that the unity power up screen does not display as it does when the app is first started up and initially loaded into memory.

So, my question is why is there a need to force quit the game at all? Is that a limitation of the S3? That is, does the S3 force quit the app when the home key is pressed? If yes, then that really sucks. If not then I would use either of the two clean methods for exiting the app from memory.

So, my guess is that by doing a force quit there are some residual aspects of the game (like a link to the second scene or something bad, as they warn..) still in memory, so that when you restart the game a memory error occurs.

Please let me know if the S3 does a force quit on Home key, since my game will be running on the S3 at some point. Thanks.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image

Answer by unimechanic · Feb 25, 2014 at 06:52 PM

Please submit a bug report with a minimal sample project (if possible, will be very helpful) that reproduces t$$anonymous$$s problem, following these guidelines and additional information:

http://unity3d.com/BugReportingFAQ

http://blogs.unity3d.com/2013/10/28/bug-reports-incidents-and-some-bas$$anonymous$$ng/

http://issuetracker-staging.unity3d.com/

The bug reporting tool is next to the Unity executable if you can't run it from the editor. Our QA team will review the issue as soon as possible, and then assign it to our developers. Having the bug report is the only way t$$anonymous$$s problem can be fixed.

Comment

People who like this

0 Show 0 · 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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

20 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

Related Questions

Android Crashes on game load 1 Answer

Unity Android app crashes when activated a few times with Android's SDK's startActivity(intent). 1 Answer

Unity Game Crashes on load using Nox 0 Answers

Load AssetBundles on Android device 1 Answer

Application Level data not available inside OBB (Android) 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