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 SM8 · Apr 09, 2014 at 09:34 PM · androidbugcrashexception

Android Build Throwing SecurityException

My application works perfectly on Windows, but when I build it for android, the app plays for a small amount of time (5-10 seconds) then does one of two very peculiar things at seemingly random times.

On Unity 4.3.0f1, it would floor one core of my CPU and freeze the entire device until force-killed. I could get nothing over logcat.

On Unity 4.3.4f1, it crashes properly, and causes Samsung's KNOX Prevention Information warning to show up. Debugging over logcat shows a SecurityException being thrown.

alt text

My app is a simple flappy bird clone (for practice, I promise), so I haven't the slightest idea as to why it would need any elevated permissions. It crashes on both my Galaxy Note 3 and my friends' Galaxy S3 and Galaxy Nexus. The fact that it does different things across different versions of Unity leads me to believe that this might be an issue with Unity. Would this be the case? The entire app has about fifty lines of code and it doesn't use I/O or networking or anything like that at any point in time.

For some reason, removing the "pipes" from the game fixes the crash, but this is all there is to the pipe code along with some colliders and sprites(it works logically in my game, it's just here for full disclosure):

     void Update () {
     
         if (this.transform.position.z == 0) {
                         this.transform.Translate (-.1f, 0, 0);
                         if (this.transform.position.x < -50.0f || !GlobalVariables.isStarted || GlobalVariables.needsMenu)
                                 GameObject.Destroy (this.gameObject);
                 }
     }
 
     void Update () {
     
         #region spawncode
 
 
         if(Mathf.Sin(Time.time * 4) > .9 && !hasSpawned)
         {
             hasSpawned = true;
             Instantiate(this, new Vector3(50, 3*Random.value - 1.5f, 0), Quaternion.identity);
         }
 
         if(Mathf.Sin(Time.time * 4) < .1 && hasSpawned)
         {
             hasSpawned = false;
         }
     
 
         #endregion
 
     }

unity crash.png (36.0 kB)
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

0 Replies

· Add your reply
  • Sort: 

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

21 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

Related Questions

Android crash at 0xdeadbaad 0 Answers

Google Play prelaunch test - java.lang.SecurityException 0 Answers

Stuck on splash screen android 0 Answers

Debugging 'Assertion failed on expression' errors. 0 Answers

Strange exporting to Android results 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