(Need Help, please...)App Crashes at random point after updating to android 7.0(has log)

Hi, thank you for having an interest in the problem I’m going through.

I’m making a simple 2D game for Android platform and I suddenly have a critical issue after updating to android 7.0. It worked perfectly fine when I did build&play before I updated my phone to android 7.0. Now, just like I said in the title, the app crashes at random point and I can’t find out what’s going on. Even on the log, I can’t find any obvious reason why the app is crashing down.

here is my log when the app crashes

02-15 15:07:43.517 28773 28808 I Unity : NullReferenceException: Object reference not set to an instance of an object
02-15 15:07:43.517 28773 28808 I Unity : at Player.Update () [0x00000] in :0
02-15 15:07:43.517 28773 28808 I Unity :
02-15 15:07:43.517 28773 28808 I Unity : (Filename: Line: -1)
02-15 15:07:43.517 28773 28808 I Unity :
02-15 15:07:43.533 28773 28808 I Unity : NullReferenceException: Object reference not set to an instance of an object
02-15 15:07:43.533 28773 28808 I Unity : at Player.Update () [0x00000] in :0
02-15 15:07:43.533 28773 28808 I Unity :
02-15 15:07:43.533 28773 28808 I Unity : (Filename: Line: -1)
02-15 15:07:43.533 28773 28808 I Unity :
02-15 15:07:43.551 28773 28808 I Unity : NullReferenceException: Object reference not set to an instance of an object
02-15 15:07:43.551 28773 28808 I Unity : at Player.Update () [0x00000] in :0
02-15 15:07:43.551 28773 28808 I Unity :
02-15 15:07:43.551 28773 28808 I Unity : (Filename: Line: -1)
02-15 15:07:43.551 28773 28808 I Unity :
02-15 15:07:43.566 28773 28808 I Unity : NullReferenceException: Object reference not set to an instance of an object
02-15 15:07:43.566 28773 28808 I Unity : at Player.Update () [0x00000] in :0
02-15 15:07:43.566 28773 28808 I Unity :
02-15 15:07:43.566 28773 28808 I Unity : (Filename: Line: -1)
02-15 15:07:43.566 28773 28808 I Unity :
02-15 15:07:43.584 28773 28808 I Unity : NullReferenceException: Object reference not set to an instance of an object
02-15 15:07:43.584 28773 28808 I Unity : at Player.Update () [0x00000] in :0
02-15 15:07:43.584 28773 28808 I Unity :
02-15 15:07:43.584 28773 28808 I Unity : (Filename: Line: -1)
02-15 15:07:43.584 28773 28808 I Unity :
02-15 15:07:43.601 28773 28808 I Unity : NullReferenceException: Object reference not set to an instance of an object
02-15 15:07:43.601 28773 28808 I Unity : at Player.Update () [0x00000] in :0
02-15 15:07:43.601 28773 28808 I Unity :
02-15 15:07:43.601 28773 28808 I Unity : (Filename: Line: -1)
02-15 15:07:43.601 28773 28808 I Unity :
02-15 15:07:43.616 28773 28808 I Unity : NullReferenceException: Object reference not set to an instance of an object
02-15 15:07:43.616 28773 28808 I Unity : at Player.Update () [0x00000] in :0
02-15 15:07:43.616 28773 28808 I Unity :
02-15 15:07:43.616 28773 28808 I Unity : (Filename: Line: -1)
02-15 15:07:43.616 28773 28808 I Unity :
↑ the exception above did not matter at all before updatinng to android 7.0
(it happens because I put touch detect script under Update() method)

02-15 15:07:43.765 3641 21142 I ActivityManager: Process com.A37Games.Swinger (pid 28773) has died(125,1396)
↑ Don’t really get why this happens.
02-15 15:07:43.765 3641 21142 D ActivityManager: cleanUpApplicationRecord – 28773
02-15 15:07:43.770 3641 21142 W ActivityManager: Force removing ActivityRecord{952f36ad0 u0 com.A37Games.Swinger/com.unity3d.player.UnityPlayerActivity t73}: app died, no saved state
02-15 15:07:43.800 3641 21142 D ActivityManager: moveToFront() : reason=appDied setFocusedActivity isAttached=true TaskRecord{85abceed0 #35 A=com.sec.android.app.launcher U=0 StackId=0 sz=1}
02-15 15:07:43.800 3641 21142 D ActivityManager: setFocusStackUnchecked: reason=appDied setFocusedActivity focusCandidate=ActivityStack{1ceddcbd0 stackId=0, 2 tasks} caller=com.android.server.am.ActivityStack.moveToFront:873 com.android.server.am.ActivityStackSupervisor.moveActivityStackToFront:1994
02-15 15:07:43.809 3641 21142 D ActivityManager: resumeTopActivityInnerLocked() : #0 prevTask=null next=ActivityRecord{835b8a2d0 u0 com.sec.android.app.launcher/.activities.LauncherActivity t35} mFocusedStack=ActivityStack{1ceddcbd0 stackId=0, 2 tasks}
02-15 15:07:43.812 3641 21142 D ActivityManager: mActivityResumeBooster.acquire()
02-15 15:07:43.984 3641 4235 D ActivityManager: post active user change for 0 fullscreen true isHomeActivity() true
02-15 15:07:44.310 3641 3770 D ActivityManager: mActivityResumeBooster.release()
02-15 15:07:44.310 3641 3770 D ActivityManager: mActivityResumeBoosterTail.acquire()

I hope to get a good clue to solving this problem!
thank you for reading

something is missing reference… can you show the script?

add Debug.Logs to few lines there to see where it happens, or check your references before using them…

and/or try this in game console,

Or test with Unity Remote, if the error happens there,
i guess it doesnt happen in editor?

1 Like

Thanks, I fixed the null reference exception issue and it works again.
It worked fine even with the same exception before the update, so I thought it’s not the one causing the trouble, but just like you pointed out, It was, indeed, the cause.

I still don’t know why it worked fine in the previous version, but anyway thanks a lot!