Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-fatal Exception: NullReferenceException on firebase crashlytics #603

Open
AnPK193 opened this issue Oct 13, 2022 · 6 comments
Open

Non-fatal Exception: NullReferenceException on firebase crashlytics #603

AnPK193 opened this issue Oct 13, 2022 · 6 comments

Comments

@AnPK193
Copy link

AnPK193 commented Oct 13, 2022

I got this issue from firebase crashlytics and not sure where this log came from:

Non-fatal Exception: NullReferenceException
0 ??? 0x0 set_localPosition (UnityEngine.Transform)
1 ??? 0x0 Invoke (DG.Tweening.Core.DOSetter1[T]) 2 ??? 0x0 ApplyTween (DG.Tweening.Core.TweenerCore3[T1,T2,TPlugOptions])
3 ??? 0x0 DoGoto (DG.Tweening.Tween)
4 ??? 0x0 Update (DG.Tweening.Core.TweenManager)
5 ??? 0x0 Update (DG.Tweening.Core.TweenManager)
6 ??? 0x0 Update (DG.Tweening.Core.DOTweenComponent)

I can not reproduce this bug. The game object seemed destroyed when a tween was in sequence. I enabled safe mode.

I used Unity 2019.4.38f1 and DOTWeen version v1.2.632
Any suggestions for me? Thanks!

@Demigiant
Copy link
Owner

Demigiant commented Oct 13, 2022

Ahoy!

That indeed means that a tween's target was NULL when trying to set its position. Safe mode will capture that and prevent the error, but on iOS safe mode works only if stripping level is set to Strip Assemblies or Script Call Optimization is set to Slow and Safe (because otherwise try-catch calls are disabled).

@AnPK193
Copy link
Author

AnPK193 commented Oct 14, 2022

Thanks, @Demigiant for your response!
I rechecked and found out that the log just happen on iOS only, but the setting was:
Managed Stripping Level: Low
Script Call Optimization: Slow and Safe
like this screenshot:
Screenshot 2022-10-14 at 9 32 32 AM
Is any wrong setting here or other settings to make Safe mode on iOS disabled?

@AnPK193
Copy link
Author

AnPK193 commented Oct 16, 2022

UPDATE: I found that the bug still happens on Android. The safe mode still enable on iOS (I tried to add a bug something like the object target was destroyed while tween playing. I made an iOS build with this bug but no error happen)

@AnPK193
Copy link
Author

AnPK193 commented Oct 16, 2022

stack trace error I found on Android crashlystic:
Non-fatal Exception: java.lang.Exception: NullReferenceException : Object reference not set to an instance of an object. at UnityEngine.Transform.set_localPosition(UnityEngine.Transform) at DG.Tweening.Core.DOSetter1[T].Invoke(DG.Tweening.Core.DOSetter1[T]) at DG.Tweening.Core.TweenerCore3[T1,T2,TPlugOptions].ApplyTween(DG.Tweening.Core.TweenerCore3[T1,T2,TPlugOptions]) at DG.Tweening.Tween.DoGoto(DG.Tweening.Tween) at DG.Tweening.Core.TweenManager.Update(DG.Tweening.Core.TweenManager) at DG.Tweening.Core.TweenManager.Update(DG.Tweening.Core.TweenManager) at DG.Tweening.Core.DOTweenComponent.Update(DG.Tweening.Core.DOTweenComponent)

@Demigiant
Copy link
Owner

I'm very puzzled. I just checked the code and that part is indeed inside a safe mode try-catch (if enabled), so it should be captured no matter what happens. The only possibility is that for some reason safe mode is indeed not enabled, but on iOS your settings look good.
I see this Unity bug related to try-catches, but your version should be ok and it seems unrelated anyway (if confusedly).
Could you try updating to DOTween's last version (API is the same so no problems there) and see if something changes?

P.S. I'm not familiar with Crashlytics, but is it possible that it reports exceptions even if they're try-caught?

@AnPK193
Copy link
Author

AnPK193 commented Oct 24, 2022

Thanks, @Demigiant we decided to use SetLink() API to put on some suspect points and keep modifying the metrics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants