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

Type 'Null' is not a subtype of type 'RenderBox' in type cast. #1

Open
jitender-skycap opened this issue Oct 24, 2024 · 10 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@jitender-skycap
Copy link

jitender-skycap commented Oct 24, 2024

I had developed an app and use firebase crashlytics to that and logged with occurrence of crash.

      Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: type 'Null' is not a subtype of type 'RenderBox' in type cast. Error thrown .
   at BaseTouchRippleGestureRecognizer._renderBox(base_recognizer.dart:40)
   at BaseTouchRippleGestureRecognizer.handleEvent(base_recognizer.dart:65)
   at PointerRouter._dispatch(pointer_router.dart:98)
   at PointerRouter._dispatchEventToRoutes.<fn>(pointer_router.dart:143)
   at _LinkedHashMapMixin.forEach(dart:collection)
   at PointerRouter._dispatchEventToRoutes(pointer_router.dart:141)
   at PointerRouter.route(pointer_router.dart:127)
   at GestureBinding.handleEvent(binding.dart:501)
   at GestureBinding.dispatchEvent(binding.dart:481)
   at RendererBinding.dispatchEvent(binding.dart:450)
   at GestureBinding._handlePointerEventImmediately(binding.dart:426)
   at GestureBinding.handlePointerEvent(binding.dart:389)
   at GestureBinding._flushPointerEventQueue(binding.dart:336)
   at GestureBinding._handlePointerDataPacket(binding.dart:305)
   
   when I tried to figure it locally no crash was found, any help.??
   
   Note:- I was using its 1.1.21 version, and now I update to latest on ie 2.2.1. Will this help in reducing crash??
@MTtankkeo
Copy link
Owner

Thanks for reporting this issue. It seems that the RenderBox being null is an extremely rare situation, which is why there is no exception handling for it. Even in the latest version, this issue could still occur, so it’s important to address it. However, it would be greatly helpful if you could provide an example code where this exception happens for more accurate testing. 😀

@MTtankkeo MTtankkeo self-assigned this Oct 24, 2024
@MTtankkeo MTtankkeo added the bug Something isn't working label Oct 24, 2024
@MTtankkeo
Copy link
Owner

Try updating to version 2.2.2 to see if the issue is resolved. (Since the structure differs from version 1.0, you may need to modify your existing code.)

@MTtankkeo MTtankkeo modified the milestone: fixed and test Oct 24, 2024
@jitender-skycap
Copy link
Author

Try updating to version 2.2.2 to see if the issue is resolved. (Since the structure differs from version 1.0, you may need to modify your existing code.)

@MTtankkeo , thanks for update, I had updated the version. Lets see after release.

@jitender-skycap
Copy link
Author

Thanks for reporting this issue. It seems that the RenderBox being null is an extremely rare situation, which is why there is no exception handling for it. Even in the latest version, this issue could still occur, so it’s important to address it. However, it would be greatly helpful if you could provide an example code where this exception happens for more accurate testing. 😀

@MTtankkeo ,
Actually this happen for iOS user only(not for android) in live app, I'm not able to reproduce it in debug mode, so can't explain much about the code.

@jitender-skycap
Copy link
Author

@MTtankkeo, I got one more crash related to this, on android device. Even this is related to other dependency (animated_list_plus) but, it might be helpful in providing you more detail.

Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown .
at AnimationController.stop(animation_controller.dart:853)
at AnimationController._animateToInternal(animation_controller.dart:677)
at AnimationController.reverse(animation_controller.dart:537)
at TouchRippleSpreadingEffect.cancel(touch_ripple_effect.dart:142)
at TouchRippleSpreadingEffect.onRejected(touch_ripple_effect.dart:161)
at _TouchRippleGestureDetectorState.initBuilders..(touch_ripple_gesture_detector.dart:235)
at TouchRippleTapGestureRecognizer.rejectGesture(touch_ripple_gesture_recognizer.dart:296)
at GestureArenaManager._resolve(arena.dart:240)
at GestureArenaEntry.resolve(arena.dart:55)
at OneSequenceGestureRecognizer.resolve(recognizer.dart:451)
at TouchRippleGestureRecognizer.reject(touch_ripple_gesture_recognizer.dart:114)
at TouchRippleGestureRecognizer.handleEvent(touch_ripple_gesture_recognizer.dart:93)
at PointerRouter._dispatch(pointer_router.dart:98)
at PointerRouter._dispatchEventToRoutes.(pointer_router.dart:143)
at _LinkedHashMapMixin.forEach(dart:collection)
at PointerRouter._dispatchEventToRoutes(pointer_router.dart:141)
at PointerRouter.route(pointer_router.dart:127)
at GestureBinding.handleEvent(binding.dart:501)
at GestureBinding.dispatchEvent(binding.dart:481)
at RendererBinding.dispatchEvent(binding.dart:450)
at GestureBinding._handlePointerEventImmediately(binding.dart:426)
at GestureBinding.handlePointerEvent(binding.dart:389)
at GestureBinding._flushPointerEventQueue(binding.dart:336)
at GestureBinding._handlePointerDataPacket(binding.dart:305)

Screenshot 2024-11-11 at 1 24 28 PM

@MTtankkeo
Copy link
Owner

Thanks, It appears that the related reorderable list package may be dynamically moving items or changing widget tree positions, which is causing unexpected exceptions related to the AnimationController. I believe I can address this by implementing additional exception handling to resolve the issue.

i will soon release version 2.2.3 with a fix or improvement for this issue.

@MTtankkeo
Copy link
Owner

MTtankkeo commented Nov 14, 2024

@MTtankkeo, I got one more crash related to this, on android device. Even this is related to other dependency (animated_list_plus) but, it might be helpful in providing you more detail.

Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown . at AnimationController.stop(animation_controller.dart:853) at AnimationController._animateToInternal(animation_controller.dart:677) at AnimationController.reverse(animation_controller.dart:537) at TouchRippleSpreadingEffect.cancel(touch_ripple_effect.dart:142) at TouchRippleSpreadingEffect.onRejected(touch_ripple_effect.dart:161) at _TouchRippleGestureDetectorState.initBuilders..(touch_ripple_gesture_detector.dart:235) at TouchRippleTapGestureRecognizer.rejectGesture(touch_ripple_gesture_recognizer.dart:296) at GestureArenaManager._resolve(arena.dart:240) at GestureArenaEntry.resolve(arena.dart:55) at OneSequenceGestureRecognizer.resolve(recognizer.dart:451) at TouchRippleGestureRecognizer.reject(touch_ripple_gesture_recognizer.dart:114) at TouchRippleGestureRecognizer.handleEvent(touch_ripple_gesture_recognizer.dart:93) at PointerRouter._dispatch(pointer_router.dart:98) at PointerRouter._dispatchEventToRoutes.(pointer_router.dart:143) at _LinkedHashMapMixin.forEach(dart:collection) at PointerRouter._dispatchEventToRoutes(pointer_router.dart:141) at PointerRouter.route(pointer_router.dart:127) at GestureBinding.handleEvent(binding.dart:501) at GestureBinding.dispatchEvent(binding.dart:481) at RendererBinding.dispatchEvent(binding.dart:450) at GestureBinding._handlePointerEventImmediately(binding.dart:426) at GestureBinding.handlePointerEvent(binding.dart:389) at GestureBinding._flushPointerEventQueue(binding.dart:336) at GestureBinding._handlePointerDataPacket(binding.dart:305)

Screenshot 2024-11-11 at 1 24 28 PM

@jitender-skycap A version 2.2.3 has been released to address this issue. Please update to the latest version and check if the exception still occurs.

@jitender-skycap
Copy link
Author

@MTtankkeo, I got one more crash related to this, on android device. Even this is related to other dependency (animated_list_plus) but, it might be helpful in providing you more detail.
Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown . at AnimationController.stop(animation_controller.dart:853) at AnimationController._animateToInternal(animation_controller.dart:677) at AnimationController.reverse(animation_controller.dart:537) at TouchRippleSpreadingEffect.cancel(touch_ripple_effect.dart:142) at TouchRippleSpreadingEffect.onRejected(touch_ripple_effect.dart:161) at _TouchRippleGestureDetectorState.initBuilders..(touch_ripple_gesture_detector.dart:235) at TouchRippleTapGestureRecognizer.rejectGesture(touch_ripple_gesture_recognizer.dart:296) at GestureArenaManager._resolve(arena.dart:240) at GestureArenaEntry.resolve(arena.dart:55) at OneSequenceGestureRecognizer.resolve(recognizer.dart:451) at TouchRippleGestureRecognizer.reject(touch_ripple_gesture_recognizer.dart:114) at TouchRippleGestureRecognizer.handleEvent(touch_ripple_gesture_recognizer.dart:93) at PointerRouter._dispatch(pointer_router.dart:98) at PointerRouter._dispatchEventToRoutes.(pointer_router.dart:143) at _LinkedHashMapMixin.forEach(dart:collection) at PointerRouter._dispatchEventToRoutes(pointer_router.dart:141) at PointerRouter.route(pointer_router.dart:127) at GestureBinding.handleEvent(binding.dart:501) at GestureBinding.dispatchEvent(binding.dart:481) at RendererBinding.dispatchEvent(binding.dart:450) at GestureBinding._handlePointerEventImmediately(binding.dart:426) at GestureBinding.handlePointerEvent(binding.dart:389) at GestureBinding._flushPointerEventQueue(binding.dart:336) at GestureBinding._handlePointerDataPacket(binding.dart:305)
Screenshot 2024-11-11 at 1 24 28 PM

@jitender-skycap A version 2.2.3 has been released to address this issue. Please update to the latest version and check if the exception still occurs.

Thanks, @MTtankkeo , will update the sdk and update you after releasing new app version.

@jitender-skycap
Copy link
Author

@MTtankkeo after updating to version 2.2.3, still getting the issue.
Please have a look to the screen shot.

Screenshot 2024-11-27 at 11 39 21 AM
Screenshot 2024-11-27 at 11 39 34 AM

MTtankkeo added a commit that referenced this issue Nov 27, 2024
@MTtankkeo
Copy link
Owner

@MTtankkeo after updating to version 2.2.3, still getting the issue. Please have a look to the screen shot.

Screenshot 2024-11-27 at 11 39 21 AM Screenshot 2024-11-27 at 11 39 34 AM

Released fix version 2.2.32 on issues related to this. Try update it version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants