Repository navigation
PageView applyViewportDimension throws Null check operator used on a null value #101007
Copy link
Copy link
Closed
Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworka: null-safetySupport for Dart's null safety featureSupport for Dart's null safety featurea: productionIssues experienced in live production appsIssues experienced in live production appsa: releaseChallenges faced when attempting to productionize an appChallenges faced when attempting to productionize an appc: crashStack traces logged to the consoleStack traces logged to the consolecp: reviewCherry-picks in the review queueCherry-picks in the review queuef: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 3.0Found to occur in 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1Found to occur in 3.1frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyAndroid applications specifically
Description
Found this very rare Crashlytics error in production on a Galaxy Note10+. I'm not sure of the trigger or a reproduction.
Looks like it's due to this:
| page = _cachedPage!; |
Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown Instance of 'ErrorDescription'.
at _PagePosition.applyViewportDimension(page_view.dart:453)
at RenderViewport.performLayout(viewport.dart:1456)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderCustomPaint.performLayout(custom_paint.dart:545)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at ChildLayoutHelper.layoutChild(layout_helper.dart:56)
at RenderStack._computeSize(stack.dart:570)
at RenderStack.performLayout(stack.dart:597)
at RenderObject.layout(object.dart:1887)
at _RenderLayoutBuilder.performLayout(layout_builder.dart:321)
at RenderObject.layout(object.dart:1887)
at MultiChildLayoutDelegate.layoutChild(custom_layout.dart:171)
at _ScaffoldLayout.performLayout(scaffold.dart:1005)
at MultiChildLayoutDelegate._callPerformLayout(custom_layout.dart:240)
at RenderCustomMultiChildLayoutBox.performLayout(custom_layout.dart:403)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at _RenderCustomClip.performLayout(proxy_box.dart:1376)
at RenderObject.layout(object.dart:1887)
at ChildLayoutHelper.layoutChild(layout_helper.dart:56)
at RenderStack._computeSize(stack.dart:570)
at RenderStack.performLayout(stack.dart:597)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at ChildLayoutHelper.layoutChild(layout_helper.dart:56)
at RenderStack._computeSize(stack.dart:570)
at RenderStack.performLayout(stack.dart:597)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderOffstage.performLayout(proxy_box.dart:3430)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at _RenderTheatre.performLayout(overlay.dart:751)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at ChildLayoutHelper.layoutChild(layout_helper.dart:56)
at RenderStack._computeSize(stack.dart:570)
at RenderStack.performLayout(stack.dart:597)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderProxyBoxMixin.performLayout(proxy_box.dart:116)
at RenderObject.layout(object.dart:1887)
at RenderView.performLayout(view.dart:165)
at RenderObject._layoutWithoutResize(object.dart:1731)
at PipelineOwner.flushLayout(object.dart:887)
at RendererBinding.drawFrame(binding.dart:497)
at WidgetsBinding.drawFrame(binding.dart:883)
at RendererBinding._handlePersistentFrameCallback(binding.dart:363)
at SchedulerBinding._invokeFrameCallback(binding.dart:1144)
at SchedulerBinding.handleDrawFrame(binding.dart:1081)
at SchedulerBinding._handleDrawFrame(binding.dart:995)
Logs
[✓] Flutter (Channel stable, 2.10.1, on macOS 12.3 21E230 darwin-arm, locale en-US)
• Flutter version 2.10.1 at /Users/james/Development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision db747aa133 (7 weeks ago), 2022-02-09 13:57:35 -0600
• Engine revision ab46186b24
• Dart version 2.16.1
• DevTools version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/james/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.1)
• 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 11.0.11+0-b60-7772763)
[✓] VS Code (version 1.65.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.32.0
[✓] Connected device (2 available)
• Apollo (mobile) • da060dc78ac99566c39cb688206b34cb424a5ee1 • ios • iOS 15.3.1 19D52
• Chrome (web) • chrome • web-javascript • Google Chrome 99.0.4844.84
! Error: Apollo is busy: Preparing the watch for development via Apollo. Xcode will continue when Apollo is finished. (code -10)
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworka: null-safetySupport for Dart's null safety featureSupport for Dart's null safety featurea: productionIssues experienced in live production appsIssues experienced in live production appsa: releaseChallenges faced when attempting to productionize an appChallenges faced when attempting to productionize an appc: crashStack traces logged to the consoleStack traces logged to the consolecp: reviewCherry-picks in the review queueCherry-picks in the review queuef: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 3.0Found to occur in 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1Found to occur in 3.1frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyAndroid applications specifically
Type
Projects
- StatusShow more project fieldsDone (PR merged)
Activity
SamTienz commentedon Apr 25, 2022
same issue here.
I'm not sure of the trigger or a reproduction, too.
krmao commentedon May 4, 2022
same issue here while flutter run --release
bleroux commentedon May 4, 2022
@krmao
It would be very helpful if you can provide a minimal reproducible sample that shows the problem, thank you.
krmao commentedon May 5, 2022
@bleroux I have fixed the problem after downgrad flutter version from 2.13.0-0.3.pre to 2.10.4.
then all the command is run ok and without exception
the version 2.13.0-0.3.pre is to fix android 12 emunitor about activity need "android:export=ture" property to install apk.
my project can reproduction but the code is private, need more operation.
14 remaining items
pPeterle commentedon May 21, 2022
I found the same problem when i test in profile mode
jiangkang commentedon May 25, 2022
same issue when use TabBarView after upgrade 3.0.1
oluwapaso commentedon May 28, 2022
I have the same issue with version 3.0.1, Runs well in debug mode, but --release mode only runs well 90% of the time on the first launch, if I close the app and restart, that's when it shows the error and the app just hangs
I/flutter (18940): Null check operator used on a null value
I/flutter (18940): #0 _PagePosition.applyViewportDimension (package:flutter/src/widgets/page_view.dart:455)
oluwapaso commentedon May 28, 2022
Hi flutter team, apparently wrapping my runApp is some delay makes it go away, I think page dimension is returning null before proper app initialization that's why the applyViewportDimention is throwing an error. The code below appears to solve it now, I hope this helps someone for now.
void main() {
WidgetsFlutterBinding.ensureInitialized();
Future.delayed(const Duration(seconds: 5), () {
runApp(MyApp());
});
}
bleroux commentedon May 28, 2022
There is a pending PR to fix this : #104405.
In the meanwhile, waiting a 5 seconds delay before calling runApp is a lot, 200ms should be enough.
oluwapaso commentedon May 28, 2022
Okay, understood, I end up using 1 second myself, at least till it's fixed
TheCarpetMerchant commentedon Jun 8, 2022
Will it be possible to cherrypick #104405 ? 99% of the time spent by my users is within a PageView, so that would be nice.
github-actions commentedon Jun 23, 2022
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.