Skip to content

RenderUiKitView _handleGlobalPointerEvent is not checking for null size #83481

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

Open
yasargil opened this issue May 27, 2021 · 27 comments
Open

RenderUiKitView _handleGlobalPointerEvent is not checking for null size #83481

yasargil opened this issue May 27, 2021 · 27 comments
Labels
a: platform-views Embedding Android/iOS views in Flutter apps found in release: 3.16 Found to occur in 3.16 found in release: 3.17 Found to occur in 3.17 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-ios iOS applications specifically team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team

Comments

@yasargil
Copy link

yasargil commented May 27, 2021

Steps to Reproduce

Sadly i have no working reproducer. Only Error reports in crashlytics.

In this function the size of the render box is used without checking if it is null:

if (!(Offset.zero & size).contains(globalToLocal(event.position))) {

It looks like there is a way for RenderUiKitView to receiver touch events bevor it is layouted and the size is still null:

Expected results:
No error Report generated.

Actual results:

Non-fatal Exception: FlutterError
Null check operator used on a null value. Error thrown Instance of 'ErrorDescription'
0  ???                            0x0 size + 1952 (box.dart:1952)
1  ???                            0x0 _handleGlobalPointerEvent + 382 (platform_view.dart:382)
2  ???                            0x0 _dispatch + 93 (pointer_router.dart:93)
3  ???                            0x0 _dispatchEventToRoutes.<fn> + 138 (pointer_router.dart:138)
4  ???                            0x0 forEach (dart:collection)
5  ???                            0x0 _dispatchEventToRoutes + 136 (pointer_router.dart:136)
6  ???                            0x0 route + 128 (pointer_router.dart:128)
7  ???                            0x0 handleEvent + 439 (binding.dart:439)
8  ???                            0x0 dispatchEvent + 419 (binding.dart:419)
9  ???                            0x0 dispatchEvent + 287 (binding.dart:287)
10 ???                            0x0 _handlePointerEventImmediately + 374 (binding.dart:374)
11 ???                            0x0 handlePointerEvent + 338 (binding.dart:338)
12 ???                            0x0 _flushPointerEventQueue + 296 (binding.dart:296)
13 ???                            0x0 _handlePointerDataPacket + 279 (binding.dart:279)
@yasargil
Copy link
Author

@cyanglaz @goderbauer @Hixie pinging you three because of commit history in both methods.

@TahaTesser TahaTesser added the in triage Presently being triaged by the triage team label May 28, 2021
@Hixie
Copy link
Contributor

Hixie commented May 28, 2021

If it's not been laid out, it's not clear how it can get events, since (if you use widgets) the render object should be created then laid out all synchronously and there's no way to handle events while that's happening...

@TahaTesser
Copy link
Member

Hi @yasargil
Can you please provide your flutter doctor -v?
Thank you

@TahaTesser TahaTesser added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 28, 2021
@yasargil
Copy link
Author

yasargil commented May 28, 2021

@Hixie
Thank you. So my assumption was wrong, do you see/know any other reason why the size would be null. We only use GoogleMaps as native view in our app.

@TahaTesser

flutter doctor -v
[✓] Flutter (Channel beta, 2.2.0-10.3.pre, on macOS 11.3.1 20E241 darwin-x64, locale de-CH)
    • Flutter version 2.2.0-10.3.pre at /Users/yasargil/tools/flutter
    • Framework revision 06e2fd6357 (vor 3 Wochen), 2021-05-08 11:28:22 -0700
    • Engine revision a123e75c60
    • Dart version 2.13.0 (build 2.13.0-211.14.beta)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/yasargil/Library/Android/sdk
    • Platform android-30, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.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 1.8.0_242-release-1644-b3-6915495)

[!] IntelliJ IDEA Community Edition (version 2017.1.4)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    ✗ Flutter plugin version 14.0 - the recommended minimum version is 16.0.0
    • Dart plugin version 171.4694.29
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[✓] VS Code (version 1.56.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.22.0

[✓] Connected device (2 available)
    • iPhone 11 Pro (mobile) • 20760870-7CA0-48B9-9500-DF9002CE45B7 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 90.0.4430.212

! Doctor found issues in 1 category.

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 28, 2021
@yasargil
Copy link
Author

yasargil commented May 28, 2021

Some more context:

  • Only happening on iOS. Probably because RenderAndroidView is using _PlatformViewGestureMixin.
  • We have a GoogleMap widget at our root route. But the error is reported all over the navigation tree even when the map ist not visible because there is a fullscreen route over it.
  • Until now no user reported any issued while using the map.

@Hixie i come back to my assumption. When i look a the code the "_handleGlobalPointerEvent" is registered in the "attach" method of the renderBox after the parent class RenderObject did send "markNeedsLayout" which may trigger a "requestVisualUpdate" on the pipeline, which apparently request a "scheduleFrame" on the engine. Are you sure that is all synchronous or cam missing a code path where the layout is done bevor attach?
Found out how it is working still investigating why size would be null under the current assumptions.

@yasargil
Copy link
Author

I have managed to reproduce the error in our app. My assumption is correct the RenderBox is attached but not layouted and has therefore has size null. This happens when the GoogleMap ist on a route below other routes in an Navigator and was never showed on screen bevor. Now touches on the screen are sent to the _handleGlobalPointerEvent leading to the stack trace mentioned.

@Hixie could it be that routes never get a layout pass when not visible in the navigator?

@yasargil
Copy link
Author

yasargil commented May 28, 2021

Steps to Reproduce

  1. Run flutter create bug.
  2. Update the files as follows:
    main.dart
minimal code sample
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: Navigator(
        pages: [
          MaterialPage(
            key: ValueKey('first'),
            child: FirstPage(),
          ),
          MaterialPage(
            key: ValueKey('second'),
            child: MyHomePage(
              title: 'Title',
            ),
          ),
        ],
        onPopPage: (route, result) {
          return false;
        },
      ),
    );
  }
}

class FirstPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: WebView(
        initialUrl: 'https://github.com/flutter/flutter/issues/83481',
      ),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key, required this.title}) : super(key: key);

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Invoke "debug painting" (press "p" in the console, choose the
          // "Toggle Debug Paint" action from the Flutter Inspector in Android
          // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
          // to see the wireframe for each widget.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

pubspec.yaml
add webview_flutter: ^2.0.8 as dependency

when you click anywhere on the screen following exception will be thrown:

logs
════════ Exception caught by gesture library ═══════════════════════════════════
The following assertion was thrown while routing a pointer event:
RenderBox was not laid out: RenderUiKitView#79a1e NEEDS-LAYOUT NEEDS-PAINT
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1930 pos 12: 'hasSize'

2

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

When the exception was thrown, this was the stack
#2      RenderBox.size
package:flutter/…/rendering/box.dart:1930
#3      RenderUiKitView._handleGlobalPointerEvent
package:flutter/…/rendering/platform_view.dart:382
#4      PointerRouter._dispatch
package:flutter/…/gestures/pointer_router.dart:93
#5      PointerRouter._dispatchEventToRoutes.<anonymous closure>
package:flutter/…/gestures/pointer_router.dart:138
#6      _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:397:8)
...
════════════════════════════════════════════════════════════════════════════════

@TahaTesser
Copy link
Member

Hi @yasargil
Thanks for the code sample

logs
                    Codesigning
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftFoundation.dylib
                    /usr/bin/codesign --force --sign - --verbose
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftFoundation.dylib
                    Codesigning
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreGraphics.dylib
                    /usr/bin/codesign --force --sign - --verbose
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreGraphics.dylib
                    Codesigning
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCore.dylib
                    /usr/bin/codesign --force --sign - --verbose
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCore.dylib
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftMetal.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftMetal.dylib
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreAudio.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreAudio.dylib
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreMedia.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreMedia.dylib
                    Code signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftMetal.dylib is unchanged; keeping original
                    Code signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreAudio.dylib is unchanged; keeping original
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftUIKit.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftUIKit.dylib
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftDispatch.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftDispatch.dylib
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreFoundation.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreFoundation.dylib
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftQuartzCore.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftQuartzCore.dylib
                    Code signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreMedia.dylib is unchanged; keeping original
                    Code signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftUIKit.dylib is unchanged; keeping original
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreImage.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreImage.dylib
                    Code signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftDispatch.dylib is unchanged; keeping original
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftDarwin.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftDarwin.dylib
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftos.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftos.dylib
                    Codesigning
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftQuartzCore.dylib
                    /usr/bin/codesign --force --sign - --verbose
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftQuartzCore.dylib
                    Codesigning
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreFoundation.dylib
                    /usr/bin/codesign --force --sign - --verbose
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreFoundation.dylib
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreGraphics.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreGraphics.dylib
                    Codesigning
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftos.dylib
                    /usr/bin/codesign --force --sign - --verbose
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftos.dylib
                    Codesigning
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreImage.dylib
                    /usr/bin/codesign --force --sign - --verbose
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreImage.dylib
                    Codesigning
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftDarwin.dylib
                    /usr/bin/codesign --force --sign - --verbose
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftDarwin.dylib
                    Code signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreGraphics.dylib is unchanged; keeping original
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftFoundation.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftFoundation.dylib
                    Code signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftFoundation.dylib is unchanged; keeping original
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreFoundation.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreFoundation.dylib
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftQuartzCore.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftQuartzCore.dylib
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftDarwin.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftDarwin.dylib
                    Code signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreFoundation.dylib is unchanged; keeping original
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftos.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftos.dylib
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreImage.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreImage.dylib
                    Code signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftQuartzCore.dylib is unchanged; keeping original
                    Code signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftos.dylib is unchanged; keeping original
                    Code signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftDarwin.dylib is unchanged; keeping original
                    Code signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCoreImage.dylib is unchanged; keeping original
                    Probing signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCore.dylib
                    /usr/bin/codesign -r- --display
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCore.dylib
                    Code signature of
                    /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libsw
                    iftCore.dylib is unchanged; keeping original

                    CodeSign /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app (in
                    target 'Runner' from project 'Runner')
                        cd /Users/tahatesser/StudioProjects/beta_flutter/ios
                        export
                        CODESIGN_ALLOCATE\=/Volumes/Extreme/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/
                        usr/bin/codesign_allocate

                        Signing Identity:     "-"

                        /usr/bin/codesign --force --sign - --entitlements
                        /Users/tahatesser/Library/Developer/Xcode/DerivedData/Runner-gcrntrybggvujmbaxtfonxnjsemv/Build/Inter
                        mediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Runner.app.xcent --timestamp\=none
                        /Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app

                    /Users/tahatesser/StudioProjects/beta_flutter/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator
                    deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment
                    target versions is 9.0 to 14.5.99. (in target 'Flutter' from project 'Pods')
                    ** BUILD SUCCEEDED **
[ +166 ms]  └─Compiling, linking and signing... (completed in 5.2s)
[        ] Xcode build done.                                           23.9s
[   +2 ms] executing: rsync -av --delete
/Users/tahatesser/StudioProjects/beta_flutter/build/ios/Debug-iphonesimulator/Runner.app
/Users/tahatesser/StudioProjects/beta_flutter/build/ios/iphonesimulator
[ +778 ms] building file list ... done
                    deleting Runner.app/Frameworks/App.framework/flutter_assets/NOTICES
                    Runner.app/
                    Runner.app/Info.plist
                    Runner.app/PkgInfo
                    Runner.app/Runner
                    Runner.app/Frameworks/
                    Runner.app/Frameworks/App.framework/
                    Runner.app/Frameworks/App.framework/App
                    Runner.app/Frameworks/App.framework/_CodeSignature/CodeResources
                    Runner.app/Frameworks/App.framework/flutter_assets/
                    Runner.app/Frameworks/App.framework/flutter_assets/AssetManifest.json
                    Runner.app/Frameworks/App.framework/flutter_assets/FontManifest.json
                    Runner.app/Frameworks/App.framework/flutter_assets/NOTICES.Z
                    Runner.app/Frameworks/App.framework/flutter_assets/isolate_snapshot_data
                    Runner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin
                    Runner.app/Frameworks/App.framework/flutter_assets/vm_snapshot_data
                    Runner.app/Frameworks/Flutter.framework/
                    Runner.app/Frameworks/Flutter.framework/Flutter
                    Runner.app/Frameworks/Flutter.framework/Info.plist
                    Runner.app/Frameworks/Flutter.framework/icudtl.dat
                    Runner.app/Frameworks/Flutter.framework/Headers/
                    Runner.app/Frameworks/Flutter.framework/Headers/Flutter.h
                    Runner.app/Frameworks/Flutter.framework/Headers/FlutterAppDelegate.h
                    Runner.app/Frameworks/Flutter.framework/Headers/FlutterBinaryMessenger.h
                    Runner.app/Frameworks/Flutter.framework/Headers/FlutterCallbackCache.h
                    Runner.app/Frameworks/Flutter.framework/Headers/FlutterChannels.h
                    Runner.app/Frameworks/Flutter.framework/Headers/FlutterCodecs.h
                    Runner.app/Frameworks/Flutter.framework/Headers/FlutterDartProject.h
                    Runner.app/Frameworks/Flutter.framework/Headers/FlutterEngine.h
                    Runner.app/Frameworks/Flutter.framework/Headers/FlutterEngineGroup.h
                    Runner.app/Frameworks/Flutter.framework/Headers/FlutterHeadlessDartRunner.h
                    Runner.app/Frameworks/Flutter.framework/Headers/FlutterMacros.h
                    Runner.app/Frameworks/Flutter.framework/Headers/FlutterPlatformViews.h
                    Runner.app/Frameworks/Flutter.framework/Headers/FlutterPlugin.h
                    Runner.app/Frameworks/Flutter.framework/Headers/FlutterPluginAppLifeCycleDelegate.h
                    Runner.app/Frameworks/Flutter.framework/Headers/FlutterTexture.h
                    Runner.app/Frameworks/Flutter.framework/Headers/FlutterViewController.h
                    Runner.app/Frameworks/Flutter.framework/Modules/
                    Runner.app/Frameworks/Flutter.framework/Modules/module.modulemap
                    Runner.app/Frameworks/Flutter.framework/_CodeSignature/
                    Runner.app/Frameworks/Flutter.framework/_CodeSignature/CodeResources
                    Runner.app/Frameworks/webview_flutter.framework/
                    Runner.app/Frameworks/webview_flutter.framework/Info.plist
                    Runner.app/Frameworks/webview_flutter.framework/webview_flutter
                    Runner.app/Frameworks/webview_flutter.framework/_CodeSignature/CodeResources
                    Runner.app/_CodeSignature/CodeResources

                    sent 82032736 bytes  received 866 bytes  54689068.00 bytes/sec
                    total size is 105556470  speedup is 1.29
[   +3 ms] executing: xcrun simctl install D72A5DAA-24E6-421B-B4F5-7CFAFB498040
/Users/tahatesser/StudioProjects/beta_flutter/build/ios/iphonesimulator/Runner.app
[+1240 ms] executing: /usr/bin/plutil -convert json -o -
/Users/tahatesser/StudioProjects/beta_flutter/build/ios/iphonesimulator/Runner.app/Info.plist
[  +11 ms] Exit code 0 from: /usr/bin/plutil -convert json -o -
/Users/tahatesser/StudioProjects/beta_flutter/build/ios/iphonesimulator/Runner.app/Info.plist
[   +1 ms]
{"CFBundleName":"beta_flutter","DTXcode":"1250","DTSDKName":"iphonesimulator14.5","UILaunchStoryboardName":"LaunchScreen","CF
BundleIcons~ipad":{"CFBundlePrimaryIcon":{"CFBundleIconFiles":["AppIcon20x20","AppIcon29x29","AppIcon40x40","AppIcon60x60","A
ppIcon76x76","AppIcon83.5x83.5"],"CFBundleIconName":"AppIcon"}},"DTSDKBuild":"18E182","CFBundleDevelopmentRegion":"en","CFBun
dleVersion":"1","BuildMachineOSBuild":"20E241","DTPlatformName":"iphonesimulator","CFBundlePackageType":"APPL","UIMainStorybo
ardFile":"Main","CFBundleSupportedPlatforms":["iPhoneSimulator"],"CFBundleShortVersionString":"1.0.0","CFBundleInfoDictionary
Version":"6.0","CFBundleExecutable":"Runner","DTCompiler":"com.apple.compilers.llvm.clang.1_0","UISupportedInterfaceOrientati
ons~ipad":["UIInterfaceOrientationPortrait","UIInterfaceOrientationPortraitUpsideDown","UIInterfaceOrientationLandscapeLeft",
"UIInterfaceOrientationLandscapeRight"],"MinimumOSVersion":"9.0","CFBundleIdentifier":"com.example.betaFlutter","UIDeviceFami
ly":[1,2],"DTPlatformVersion":"14.5","CFBundleSignature":"????","CFBundleIcons":{"CFBundlePrimaryIcon":{"CFBundleIconFiles":[
"AppIcon20x20","AppIcon29x29","AppIcon40x40","AppIcon60x60"],"CFBundleIconName":"AppIcon"}},"DTXcodeBuild":"12E262","LSRequir
esIPhoneOS":true,"UISupportedInterfaceOrientations":["UIInterfaceOrientationPortrait","UIInterfaceOrientationLandscapeLeft","
UIInterfaceOrientationLandscapeRight"],"UIViewControllerBasedStatusBarAppearance":false,"NSBonjourServices":["_dartobservator
y._tcp"],"DTPlatformBuild":"18E182","NSLocalNetworkUsageDescription":"Allow Flutter tools on your computer to connect and
debug your application. This prompt will not appear on release builds."}
[   +4 ms] executing: xcrun simctl launch D72A5DAA-24E6-421B-B4F5-7CFAFB498040 com.example.betaFlutter
--enable-dart-profiling --enable-checked-mode --verify-entry-points --observatory-port=0
[ +272 ms] com.example.betaFlutter: 37536
[        ] Waiting for observatory port to be available...
[ +724 ms] Observatory URL on device: http://127.0.0.1:60884/Xn0vYPNSZk0=/
[  +10 ms] Caching compiled dill
[ +212 ms] Connecting to service protocol: http://127.0.0.1:60884/Xn0vYPNSZk0=/
[ +200 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at
http://127.0.0.1:60884/Xn0vYPNSZk0=/.
[  +94 ms] DDS is listening at http://127.0.0.1:60889/0eScwzT6yPI=/.
[  +84 ms] Successfully connected to service protocol: http://127.0.0.1:60884/Xn0vYPNSZk0=/
[  +26 ms] DevFS: Creating new filesystem on the device (null)
[  +22 ms] DevFS: Created new filesystem on the device
(file:///Users/tahatesser/Library/Developer/CoreSimulator/Devices/D72A5DAA-24E6-421B-B4F5-7CFAFB498040/data/Containers/Data/A
pplication/1CFFA0C7-A79A-464C-ABD7-D0FE78A639B9/tmp/beta_flutter7FC9El/beta_flutter/)
[   +3 ms] Updating assets
[ +130 ms] Syncing files to device iPhone 12...
[   +2 ms] <- reset
[        ] Compiling dart to kernel with 0 updated files
[   +4 ms] <- recompile package:beta_flutter/main.dart 8b85966d-55c0-4137-82b2-0918df9f14e0
[        ] <- 8b85966d-55c0-4137-82b2-0918df9f14e0
[ +228 ms] Updating files.
[        ] DevFS: Sync finished
[        ] Syncing files to device iPhone 12... (completed in 236ms)
[        ] Synced 0.0MB.
[   +1 ms] <- accept
[   +9 ms] Connected to _flutterView/0x7f8b9880ee20.
[   +3 ms] Flutter run key commands.
[   +1 ms] r Hot reload. 🔥🔥🔥
[        ] R Hot restart.
[        ] h List all available interactive commands.
[        ] d Detach (terminate "flutter run" but leave application running).
[        ] c Clear the screen
[        ] q Quit (terminate the application on the device).
[        ] 💪 Running with sound null safety 💪
[        ] An Observatory debugger and profiler on iPhone 12 is available at: http://127.0.0.1:60889/0eScwzT6yPI=/
[ +332 ms] DevTools activation throttled until 2021-05-28 22:25:11.789800.
[ +684 ms] The Flutter DevTools debugger and profiler on iPhone 12 is available at:
                    http://127.0.0.1:9102?uri=http%3A%2F%2F127.0.0.1%3A60889%2F0eScwzT6yPI%3D%2F
[+30140 ms] 
                     ══╡ EXCEPTION CAUGHT BY GESTURE LIBRARY ╞═══════════════════════════════════════════════════════════
                     The following assertion was thrown while routing a pointer event:
                     RenderBox was not laid out: RenderUiKitView#fe2b9 NEEDS-LAYOUT NEEDS-PAINT
                     'package:flutter/src/rendering/box.dart':
                     Failed assertion: line 1929 pos 12: 'hasSize'
                     
                     Either the assertion indicates an error in the framework itself, or we should provide substantially
                     more information in this error message to help you determine and fix the underlying cause.
                     In either case, please report this assertion by filing a bug on GitHub:
                       https://github.com/flutter/flutter/issues/new?template=2_bug.md
                     
                     When the exception was thrown, this was the stack:
                     #2      RenderBox.size (package:flutter/src/rendering/box.dart:1929:12)
                     #3      RenderUiKitView._handleGlobalPointerEvent
(package:flutter/src/rendering/platform_view.dart:382:25)
                     #4      PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:94:12)
                     #5      PointerRouter._dispatchEventToRoutes.<anonymous closure>
(package:flutter/src/gestures/pointer_router.dart:139:9)
                     #6      _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:397:8)
                     #7      PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:137:18)
                     #8      PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:129:5)
                     #9      GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:440:19)
                     #10     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:420:22)
                     #11     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:287:11)
                     #12     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:374:7)
                     #13     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:338:5)
                     #14     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:296:7)
                     #15     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:279:7)
                     #19     _invoke1 (dart:ui/hooks.dart:182:10)
                     #20     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:282:7)
                     #21     _dispatchPointerDataPacket (dart:ui/hooks.dart:96:31)
                     (elided 5 frames from class _AssertionError and dart:async)
                     
                     router: Instance of 'PointerRouter'
                     route: Closure: (PointerEvent) => void from Function '_handleGlobalPointerEvent@361508051':.
                     event: PointerDownEvent#e057e(position: Offset(162.3, 536.7))
                     ════════════════════════════════════════════════════════════════════════════════════════════════════
[ +457 ms] 
                    Another exception was thrown: RenderBox was not laid out: RenderUiKitView#fe2b9 NEEDS-LAYOUT NEEDS-PAINT

Tested the code sample on the following channels

stable beta dev master

Check flutter doctor -v outputs for each channel below

flutter doctor -v
[✓] Flutter (Channel stable, 2.2.1, on macOS 11.3.1 20E241 darwin-x64, locale
    en-GB)
    • Flutter version 2.2.1 at /Users/tahatesser/Code/flutter_stable
    • Framework revision 02c026b03c (19 hours ago), 2021-05-27 12:24:44 -0700
    • Engine revision 0fdb562ac8
    • Dart version 2.13.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Volumes/Extreme/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Volumes/Extreme/SDK
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.5, Build version 12E262
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • 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.8+10-b944.6916264)

[✓] VS Code (version 1.56.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.22.0

[✓] Connected device (4 available)
    • Taha’s iPhone (mobile) • 00008020-001059882212002E            • ios
      • iOS 14.6
    • iPhone 12 (mobile)     • D72A5DAA-24E6-421B-B4F5-7CFAFB498040 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64
      • macOS 11.3.1 20E241 darwin-x64
    • Chrome (web)           • chrome                               •
      web-javascript • Google Chrome 90.0.4430.212

• No issues found!
[✓] Flutter (Channel beta, 2.2.0, on macOS 11.3.1 20E241 darwin-x64, locale
    en-GB)
    • Flutter version 2.2.0 at /Users/tahatesser/Code/flutter_beta
    • Framework revision b22742018b (2 weeks ago), 2021-05-14 19:12:57 -0700
    • Engine revision a9d88a4d18
    • Dart version 2.13.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Volumes/Extreme/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Volumes/Extreme/SDK
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.5, Build version 12E262
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • 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.8+10-b944.6916264)

[✓] VS Code (version 1.56.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.22.0

[✓] Connected device (4 available)
    • Taha’s iPhone (mobile) • 00008020-001059882212002E            • ios
      • iOS 14.6
    • iPhone 12 (mobile)     • D72A5DAA-24E6-421B-B4F5-7CFAFB498040 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64
      • macOS 11.3.1 20E241 darwin-x64
    • Chrome (web)           • chrome                               •
      web-javascript • Google Chrome 90.0.4430.212

• No issues found!
[✓] Flutter (Channel dev, 2.3.0-16.0.pre, on macOS 11.3.1 20E241 darwin-x64,
    locale en-GB)
    • Flutter version 2.3.0-16.0.pre at /Users/tahatesser/Code/flutter_dev
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision fa5883b78e (7 days ago), 2021-05-21 13:04:03 -0700
    • Engine revision 2f067fc4c5
    • Dart version 2.14.0 (build 2.14.0-136.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Volumes/Extreme/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Volumes/Extreme/SDK
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.5, Build version 12E262
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • 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.8+10-b944.6916264)

[✓] IntelliJ IDEA Community Edition (version 2021.1.1)
    • IntelliJ at /Volumes/Extreme/IntelliJ IDEA CE.app
    • Flutter plugin version 56.0.5
    • Dart plugin version 211.7233

[✓] VS Code (version 1.56.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.22.0

[✓] Connected device (4 available)
    • Taha’s iPhone (mobile) • 00008020-001059882212002E            • ios
      • iOS 14.6
    • iPhone 12 (mobile)     • D72A5DAA-24E6-421B-B4F5-7CFAFB498040 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64
      • macOS 11.3.1 20E241 darwin-x64
    • Chrome (web)           • chrome                               •
      web-javascript • Google Chrome 90.0.4430.212

• No issues found!
[✓] Flutter (Channel master, 2.3.0-17.0.pre.111, on macOS 11.3.1 20E241
    darwin-x64, locale en-GB)
    • Flutter version 2.3.0-17.0.pre.111 at
      /Users/tahatesser/Code/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6a38994cb8 (8 hours ago), 2021-05-28 02:09:02 -0400
    • Engine revision ecfd7bdffe
    • Dart version 2.14.0 (build 2.14.0-162.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Volumes/Extreme/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Volumes/Extreme/SDK
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.5, Build version 12E262
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • 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.8+10-b944.6916264)

[✓] IntelliJ IDEA Community Edition (version 2021.1.1)
    • IntelliJ at /Volumes/Extreme/IntelliJ IDEA CE.app
    • Flutter plugin version 56.0.5
    • Dart plugin version 211.7233

[✓] VS Code (version 1.56.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.22.0

[✓] Connected device (4 available)
    • Taha’s iPhone (mobile) • 00008020-001059882212002E            • ios
      • iOS 14.6
    • iPhone 12 (mobile)     • D72A5DAA-24E6-421B-B4F5-7CFAFB498040 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64
      • macOS 11.3.1 20E241 darwin-x64
    • Chrome (web)           • chrome                               •
      web-javascript • Google Chrome 90.0.4430.212

• No issues found!

✅ : No Issue ❗: Has issue

@TahaTesser TahaTesser added a: platform-views Embedding Android/iOS views in Flutter apps found in release: 2.2 Found to occur in 2.2 found in release: 2.3 Found to occur in 2.3 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-ios iOS applications specifically and removed in triage Presently being triaged by the triage team labels May 28, 2021
@goderbauer
Copy link
Member

Thanks for debugging the issue and the reproducible code sample. It looks like _handleGlobalPointerEvent needs to ignore pointer events if it hasn't been layed out yet. Not sure if it needs to communicate that to the UiKitViewController, though.

/cc @jmagman

@Hixie
Copy link
Contributor

Hixie commented Jun 2, 2021

@goderbauer How is _handleGlobalPointerEvent getting called if the render object isn't yet laid out?

@Hixie
Copy link
Contributor

Hixie commented Jun 2, 2021

If anyone has a complete stack trace they could post that would be great.

@yasargil
Copy link
Author

yasargil commented Jun 3, 2021

Not sure what stack trace you need.

In the widget inspector for the reproducer i see this:
Bildschirmfoto 2021-06-03 um 10 15 33

Looks like the _Theatre is skips layout for not the first _OverlayEntryWidget

@Hixie
Copy link
Contributor

Hixie commented Jun 3, 2021

Ah what I meant was the stack trace @TahaTesser posted in #83481 (comment):

                     ══╡ EXCEPTION CAUGHT BY GESTURE LIBRARY ╞═══════════════════════════════════════════════════════════
                     The following assertion was thrown while routing a pointer event:
                     RenderBox was not laid out: RenderUiKitView#fe2b9 NEEDS-LAYOUT NEEDS-PAINT
                     'package:flutter/src/rendering/box.dart':
                     Failed assertion: line 1929 pos 12: 'hasSize'
                     
                     Either the assertion indicates an error in the framework itself, or we should provide substantially
                     more information in this error message to help you determine and fix the underlying cause.
                     In either case, please report this assertion by filing a bug on GitHub:
                       https://github.com/flutter/flutter/issues/new?template=2_bug.md
                     
                     When the exception was thrown, this was the stack:
                     #2      RenderBox.size (package:flutter/src/rendering/box.dart:1929:12)
                     #3      RenderUiKitView._handleGlobalPointerEvent (package:flutter/src/rendering/platform_view.dart:382:25)
                     #4      PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:94:12)
                     #5      PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:139:9)
                     #6      _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:397:8)
                     #7      PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:137:18)
                     #8      PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:129:5)
                     #9      GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:440:19)
                     #10     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:420:22)
                     #11     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:287:11)
                     #12     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:374:7)
                     #13     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:338:5)
                     #14     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:296:7)
                     #15     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:279:7)
                     #19     _invoke1 (dart:ui/hooks.dart:182:10)
                     #20     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:282:7)
                     #21     _dispatchPointerDataPacket (dart:ui/hooks.dart:96:31)
                     (elided 5 frames from class _AssertionError and dart:async)
                     
                     router: Instance of 'PointerRouter'
                     route: Closure: (PointerEvent) => void from Function '_handleGlobalPointerEvent@361508051':.
                     event: PointerDownEvent#e057e(position: Offset(162.3, 536.7))
                     ════════════════════════════════════════════════════════════════════════════════════════════════════

Your last comment is very illuminating, though -- the _Theatre is skipping the off-screen children, yet the RenderUiKitView is still listening to events even though they didn't get hit test to touch it. That's fascinating! Why is that object listening to all events like that?

@yasargil
Copy link
Author

yasargil commented Jun 3, 2021

@amirh introduced this change in this commit: 5099701

@goderbauer
Copy link
Member

@Hixie The RenderObject in question registers a global pointer route on attach:

GestureBinding.instance!.pointerRouter.addGlobalRoute(_handleGlobalPointerEvent);

With that, it will get all pointer events even when it isn't layed out (as in the case where its OverlayEntry is covered by other opaque OverlayEntries).

So, one way to fix it would be to make the pointer route it registers aware that the object may not be layed out (or that the layout may even be outdated). Another way could be to refactor how the render object receives pointer events. Not sure how to do the latter, though, since it sounds like the object also needs to know about events that don't hit it to tell the native side to not handle those...

@Hixie
Copy link
Contributor

Hixie commented Jun 3, 2021

Yeah I guess I was just wrong about the fact that a render object existing means it gets laid out in that frame, given _Theatre's behaviour.

Just doing nothing if we haven't laid out isn't going to be enough because it's also possible that we have laid out, then went offstage, and our parent moved. This means would that our layout information is invalid (maybe wildly so, consider e.g. something being kept alive in a list that has scrolled by a million pixels since we were last laid out).

@chunhtai
Copy link
Contributor

chunhtai commented Dec 3, 2021

@Hixie keptalive child will be detached, and the renderUIKit will unregister itself from global pointer event, the Offstage one maybe tricky though, I wonder whether we can check whether we are off stage

@goderbauer goderbauer added the P2 Important issues not at the top of the work list label Apr 20, 2022
@KaranSingh1412
Copy link

is this issue actually fixed?
I get the same error with using the GoogleMap Widget, even though it's not rendered. It is indeed in one of my other routes and I can tell that this a bug using the GoogleMap Widget because when I remove it, everything works just fine.

Ah what I meant was the stack trace @TahaTesser posted in #83481 (comment):

                     ══╡ EXCEPTION CAUGHT BY GESTURE LIBRARY ╞═══════════════════════════════════════════════════════════
                     The following assertion was thrown while routing a pointer event:
                     RenderBox was not laid out: RenderUiKitView#fe2b9 NEEDS-LAYOUT NEEDS-PAINT
                     'package:flutter/src/rendering/box.dart':
                     Failed assertion: line 1929 pos 12: 'hasSize'
                     
                     Either the assertion indicates an error in the framework itself, or we should provide substantially
                     more information in this error message to help you determine and fix the underlying cause.
                     In either case, please report this assertion by filing a bug on GitHub:
                       https://github.com/flutter/flutter/issues/new?template=2_bug.md
                     
                     When the exception was thrown, this was the stack:
                     #2      RenderBox.size (package:flutter/src/rendering/box.dart:1929:12)
                     #3      RenderUiKitView._handleGlobalPointerEvent (package:flutter/src/rendering/platform_view.dart:382:25)
                     #4      PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:94:12)
                     #5      PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:139:9)
                     #6      _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:397:8)
                     #7      PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:137:18)
                     #8      PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:129:5)
                     #9      GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:440:19)
                     #10     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:420:22)
                     #11     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:287:11)
                     #12     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:374:7)
                     #13     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:338:5)
                     #14     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:296:7)
                     #15     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:279:7)
                     #19     _invoke1 (dart:ui/hooks.dart:182:10)
                     #20     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:282:7)
                     #21     _dispatchPointerDataPacket (dart:ui/hooks.dart:96:31)
                     (elided 5 frames from class _AssertionError and dart:async)
                     
                     router: Instance of 'PointerRouter'
                     route: Closure: (PointerEvent) => void from Function '_handleGlobalPointerEvent@361508051':.
                     event: PointerDownEvent#e057e(position: Offset(162.3, 536.7))
                     ════════════════════════════════════════════════════════════════════════════════════════════════════

Your last comment is very illuminating, though -- the _Theatre is skipping the off-screen children, yet the RenderUiKitView is still listening to events even though they didn't get hit test to touch it. That's fascinating! Why is that object listening to all events like that?

@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team labels Jul 8, 2023
@Reprevise
Copy link

Can this, uhh, get addressed? I'm on 3.13.9.
image

Non-fatal Exception: FlutterError
Bad state: RenderBox was not laid out: RenderUiKitView#f24d4. Error thrown while routing a pointer event.

Non-fatal Exception: FlutterError
0  ???                            0x0 RenderBox.size + 1987 (box.dart:1987)
1  ???                            0x0 RenderUiKitView._handleGlobalPointerEvent + 389 (platform_view.dart:389)
2  ???                            0x0 PointerRouter._dispatch + 98 (pointer_router.dart:98)
3  ???                            0x0 PointerRouter._dispatchEventToRoutes.<fn> + 143 (pointer_router.dart:143)
4  ???                            0x0 _LinkedHashMapMixin.forEach (dart:collection)
5  ???                            0x0 PointerRouter._dispatchEventToRoutes + 141 (pointer_router.dart:141)
6  ???                            0x0 PointerRouter.route + 133 (pointer_router.dart:133)
7  ???                            0x0 GestureBinding.handleEvent + 488 (binding.dart:488)
8  ???                            0x0 GestureBinding.dispatchEvent + 468 (binding.dart:468)
9  ???                            0x0 RendererBinding.dispatchEvent + 333 (binding.dart:333)
10 ???                            0x0 GestureBinding._handlePointerEventImmediately + 413 (binding.dart:413)
11 ???                            0x0 GestureBinding.handlePointerEvent + 376 (binding.dart:376)
12 ???                            0x0 GestureBinding._flushPointerEventQueue + 323 (binding.dart:323)
13 ???                            0x0 GestureBinding._handlePointerDataPacket + 292 (binding.dart:292)

@huycozy
Copy link
Member

huycozy commented Nov 24, 2023

Reproduced the issue on the latest stable and master channel with a pure platform view example (without using webview_flutter plugin) at platform_route_138315.

Entire exception log
======== Exception caught by gesture library =======================================================
The following assertion was thrown while routing a pointer event:
RenderBox was not laid out: RenderUiKitView#5471d NEEDS-LAYOUT NEEDS-PAINT
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1972 pos 12: 'hasSize'


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.yml

When the exception was thrown, this was the stack: 
#2      RenderBox.size (package:flutter/src/rendering/box.dart:1972:12)
#3      RenderDarwinPlatformView._handleGlobalPointerEvent (package:flutter/src/rendering/platform_view.dart:353:25)
#4      PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:98:12)
#5      PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:143:9)
#6      _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:633:13)
#7      PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:141:18)
#8      PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:133:5)
#9      GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:488:19)
#10     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:468:22)
#11     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:430:11)
#12     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:413:7)
#13     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:376:5)
#14     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:323:7)
#15     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:292:9)
#16     _invoke1 (dart:ui/hooks.dart:328:13)
#17     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:409:7)
#18     _dispatchPointerDataPacket (dart:ui/hooks.dart:262:31)
(elided 2 frames from class _AssertionError)
====================================================================================================
flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.16.0, on macOS 14.1 23B74 darwin-x64, locale en-VN)
    • Flutter version 3.16.0 on channel stable at /Users/huynq/Documents/GitHub/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision db7ef5bf9f (8 hours ago), 2023-11-15 11:25:44 -0800
    • Engine revision 74d16627b9
    • Dart version 3.2.0
    • DevTools version 2.28.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/huynq/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.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.13.0

[✓] 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 Giraffe.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)

[!] Android Studio (version unknown)
    • Android Studio at /Applications/Android Studio Preview.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
    ✗ Unable to determine Android Studio version.
    • Java version OpenJDK Runtime Environment (build 17.0.8+0-17.0.8b1000.22-10799086)

[✓] Android Studio (version 2022.2)
    • 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
    • android-studio-dir = /Applications/Android Studio.app/
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.84.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.76.0

[✓] Connected device (3 available)
    • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64  • Android 11 (API 30)
    • macOS (desktop)  • macos            • darwin-x64     • macOS 14.1 23B74 darwin-x64
    • Chrome (web)     • chrome           • web-javascript • Google Chrome 119.0.6045.123

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
[!] Flutter (Channel master, 3.17.0-15.0.pre.20, on macOS 14.1 23B74 darwin-x64, locale en-VN)
    • Flutter version 3.17.0-15.0.pre.20 on channel master at /Users/huynq/Documents/GitHub/flutter_master
    ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4d75edb3c0 (5 hours ago), 2023-11-23 17:09:23 -0500
    • Engine revision 152790b581
    • Dart version 3.3.0 (build 3.3.0-152.0.dev)
    • DevTools version 2.30.0-dev.4
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/huynq/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.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (version unknown)
    • Android Studio at /Applications/Android Studio Preview.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
    ✗ Unable to determine Android Studio version.
    • Java version OpenJDK Runtime Environment (build 17.0.8+0-17.0.8b1000.22-10799086)

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio Giraffe Patch 3.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)

[✓] Android Studio (version 2022.2)
    • 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
    • android-studio-dir = /Applications/Android Studio.app/
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.84.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.76.0

[✓] Connected device (3 available)
    • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64  • Android 11 (API 30)
    • macOS (desktop)  • macos            • darwin-x64     • macOS 14.1 23B74 darwin-x64
    • Chrome (web)     • chrome           • web-javascript • Google Chrome 119.0.6045.159

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.

@huycozy huycozy added found in release: 3.16 Found to occur in 3.16 found in release: 3.17 Found to occur in 3.17 and removed found in release: 2.2 Found to occur in 2.2 found in release: 2.3 Found to occur in 2.3 multiteam-retriage-candidate labels Nov 24, 2023
@huco

This comment was marked as duplicate.

@Reprevise
Copy link

Reprevise commented Jan 11, 2024

One workaround you can use is by using the visibility_detector package like below.

This hides the PlatformView while it is not visible which removes the error as described above.

This issue should be given more priority however. It has been 3 years since this issue was opened.

import 'package:visibility_detector/visibility_detector.dart';

class NativeViewIOS extends StatefulWidget {
  const NativeViewIOS({Key? key}) : super(key: key);

  @override
  State<NativeViewIOS> createState() => _NativeViewIOSState();
}

class _NativeViewIOSState extends State<NativeViewIOS> {
  bool _isVisible = false;

  @override
  Widget build(BuildContext context) {
    return VisibilityDetector(
      onVisibilityChanged: (info) {
        if (!mounted) return;

        if (info.visibleFraction < 1 && _isVisible) {
          setState(() {
            _isVisible = false;
          });
        } else if (info.visibleFraction == 1 && !_isVisible) {
          setState(() {
            _isVisible = true;
          });
        }
      },
      key: Key(/* Insert name for the key here */),
      child: Visibility(
        visible: _isVisible,
        child: /* Platform view code here */,
      ),
    );
  }
}

@moheb-badawy
Copy link

Hi @danagbemava-nc ,
Your support in this issue is appreciated as it has been opened for 3 years already.

@moheb-badawy
Copy link

Hi @chunhtai , @danagbemava-nc ,
Flutter released v.3.24.1, when can we expect a solution for this issue?

@MarinCouderc
Copy link

Can confirm having the same issue while using webview_flutter plugin.

@l-jeftic-vegait
Copy link

I consistently receive this error after version 2.7.1. Everything worked fine before that version. This occurs when I have a WebView or AdWidget in the list.

@DaVaMa1
Copy link

DaVaMa1 commented Apr 7, 2025

I have been receiving this error for quite some time now. It happens incidentally in a NestedScrollView=> Tabbarview => Listview.builder. Only on iOS. 100% from AdWidgets.

I'd just like to add a very very simple work around for anyone experiencing this and getting spammed in Sentry.

    FlutterError.onError = (FlutterErrorDetails details) {
      if (_isRenderUiKitViewStateError(details)) {
        return;
      }
      flutterError!(details);
    };

  bool _isRenderUiKitViewStateError(
    FlutterErrorDetails details,
  ) {
    final exception = details.exception;
    return details.library == 'gesture library' &&
        exception is AssertionError &&
        cast<String>(exception.message)
                ?.contains('RenderBox was not laid out: RenderUiKitView') ==
            true;
  }

There are probably other ways of doing this, but callign this after sentry has initialized and added it's own handler to FlutterError.OnError you can just wrap it and filter these out. I couldn't figure out how to otherwise filter out errors on this specific stream. The cast is a simple custom function, check whatever specifics you want on the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: platform-views Embedding Android/iOS views in Flutter apps found in release: 3.16 Found to occur in 3.16 found in release: 3.17 Found to occur in 3.17 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-ios iOS applications specifically team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team
Projects
None yet
Development

No branches or pull requests

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy