- Home /
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.
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
}
Your answer
Follow this Question
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