Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
1
Question by stblue · Feb 26, 2015 at 03:18 PM · androidcrash log

Application crashes while calling Application.Quit() ?

I am working on an android game, and i find that whenever i call application.quit() my game will crash..

Here is the code

 public void Update()
 {
  if(Input.key(Keycode.Escape)
  {
    Application.Quit();
  }
 }


Here is the logcat

 DALVIK THREADS:
 (mutexes: tll=0 tsl=0 tscl=0 ghl=0)
 
 "main" prio=5 tid=1 TIMED_WAIT
 | group="main" sCount=1 dsCount=0 obj=0x41b03728 self=0x41aee600
 | sysTid=31780 nice=0 sched=0/0 cgrp=apps handle=1074147324
 | state=S schedstat=( 0 0 0 ) utm=118 stm=42 core=0
 at java.lang.Object.wait(Native Method)
 - waiting on <0x41b03b28> (a java.lang.VMThread) held by tid=1 (main)
 at java.lang.Thread.parkFor(Thread.java:1205)
 at sun.misc.Unsafe.park(Unsafe.java:325)
 at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:199)
 at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1009)
 at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1302)
 at java.util.concurrent.Semaphore.tryAcquire(Semaphore.java:382)
 at com.unity3d.player.UnityPlayer.pause((null):-1)
 at com.unity3d.player.UnityPlayerNativeActivity.onPause((null):-1)
 at android.app.Activity.performPause(Activity.java:5235)
 at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1233)
 at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3145)
 at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3114)
 at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3092)
 at android.app.ActivityThread.access$800(ActivityThread.java:150)
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1315)
 at android.os.Handler.dispatchMessage(Handler.java:99)
 at android.os.Looper.loop(Looper.java:213)
 at android.app.ActivityThread.main(ActivityThread.java:5225)
 at java.lang.reflect.Method.invokeNative(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:525)
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:741)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
 at dalvik.system.NativeStart.main(Native Method)


I dont understand why this is happening ?

Comment
Add comment · Show 6
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 gameplay4all · Feb 26, 2015 at 04:04 PM 0
Share

It seems strange to me that you use a keyboard command for an android game, that makes me think that you are testing the game in the editor. Application.Quit() doesn't work in the editor. This information might help you solve your problem :) Good luck!

avatar image meat5000 ♦ · Feb 26, 2015 at 04:07 PM 0
Share

@gameplay4all Escape maps to the Back Button

avatar image gameplay4all · Feb 26, 2015 at 04:11 PM 0
Share

@meat5000 Oh really? Guess I learned another thing today ;) thank you.

avatar image meat5000 ♦ · Feb 26, 2015 at 04:14 PM 0
Share

You're welcome :)

avatar image jim0_o · Mar 19, 2015 at 12:27 AM 0
Share

Bump, did you get an answer ? I'm having this issue after converting my project to Unity 5. Searching around makes me think its the Google Play plugin, are you using it ?

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by neowedge · Dec 05, 2016 at 11:55 AM

I'm not sure if I arrive late, but, for future users, be sure that you delete all your events subscriptions on the OnDestroy of the subscriber (the event could try to trigger the event to a destroyed class).

Example:

 void OnDestroy() {
     if (theObjectIAmListening != null) {
         theObjectIAmListening.TheEvent -= MyEventHandler;
     }
 }
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

25 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

Related Questions

My android game is crashing on stock nexus 4 running Android 5.1.1 . My unity versioin 4.6.7p2 ? Its running on other android devices.I've attached logcat.But i don't understand it.Need urgent help 1 Answer

(GameName) has stopped and Keeps stopping 0 Answers

App crash on Android device but not in the editor 0 Answers

empty android app failed launch on unity 5.4.0b11 0 Answers

My game has got a lot of crashes on Android Platform, ??? libunity.0x39be38 Caused by java.lang.Error 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