Open nikorehnback opened 5 months ago
Not sure what happens if this placeholder gets unmounted before the postframe callback fires (or if that can happen). But I think that would result in the renderbox check failing.
Labeling for team's tracking.
Yeah, looks like the frame callback is missing a check for attached
.
Getting several crash reports due to this error too. in my case, they are all happening in IOS.
I am experiencing the same issue. It currently occurs at least with Lottie and ClipPath.
they are all happening in IOS.
we see the same in 3.22 on Android devices
_TypeError: Null check operator used on a null value
File "object.dart", line 3339, in RenderObject.getTransformTo
File "box.dart", line 2886, in RenderBox.localToGlobal
File "platform_view.dart", line 1526, in _PlatformViewPlaceholderBox.performLayout.<fn>
File "binding.dart", line 1392, in SchedulerBinding._invokeFrameCallback
File "binding.dart", line 1326, in SchedulerBinding.handleDrawFrame
File "binding.dart", line 1171, in SchedulerBinding._handleDrawFrame
File "zone.dart", line 1399, in _rootRun
File "zone.dart", line 1301, in _CustomZone.run
File "zone.dart", line 1209, in _CustomZone.runGuarded
File "hooks.dart", line 314, in _invoke
File "platform_dispatcher.dart", line 419, in PlatformDispatcher._drawFrame
File "hooks.dart", line 283, in _drawFrame
Steps to reproduce
Not sure how to reproduce the scenario. Got thousands of crashes reported into Crashlytics.
Expected results
Flutter framework shouldn't crash. Looking at the source code owner is force casted to non null:
final RenderObject? rootNode = owner!.rootNode;
Actual results
Flutter framework crashes with null pointer exception. Would be nice to understand if this is a bug in Flutter and if not, in which scenario this can happen.
Code sample
-
Screenshots or Video
No response
Logs
Logs
```console Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown . #00 pc 0x365b13 com.app.redacted (RenderObject.getTransformTo [object.dart:3337]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf) #01 pc 0x365bb3 com.app.redacted (RenderBox.localToGlobal [box.dart:2619]) (BuildId: b866ace1c9279fdbf7dae5b7041a6fbf) #02 pc 0x3e4f23 com.app.redacted (_PlatformViewPlaceholderBox.performLayout.Flutter Doctor output
Doctor output
```console [✓] Flutter (Channel stable, 3.19.5, on macOS 13.5 22G74 darwin-arm64, locale en-GB) • Flutter version 3.19.5 on channel stable at /Users/developer/Downloads/development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 300451adae (8 weeks ago), 2024-03-27 21:54:07 -0500 • Engine revision e76c956498 • Dart version 3.3.3 • DevTools version 2.31.1 [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc2) • Android SDK at /Users/developer/Library/Android/sdk • Platform android-34, build-tools 33.0.0-rc2 • ANDROID_HOME = /Users/developer/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15C65 • CocoaPods version 1.14.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2022.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231) [✓] VS Code (version 1.86.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.82.0 [✓] Connected device (3 available) • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 14 (API 34) (emulator) • macOS (desktop) • macos • darwin-arm64 • macOS 13.5 22G74 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.208 [✓] Network resources • All expected network resources are available. • No issues found! ```