8000 UI actions are only available on root isolate · Issue #79353 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

UI actions are only avai 8000 lable on root isolate #79353

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

Closed
ModWU opened this issue Mar 30, 2021 · 4 comments
Closed

UI actions are only available on root isolate #79353

ModWU opened this issue Mar 30, 2021 · 4 comments
Labels
r: duplicate Issue is closed as a duplicate of an existing issue

Comments

@ModWU
Copy link
ModWU commented Mar 30, 2021

My application has a function to preview files, when the file size is very large, I need to divide the text into many parts and load them lazily using the ListView, but I need to calculate the length of the ListView in advance to display the scroll bar, I would take the calculating process on the UI thread that leads to the UI lag problem, so I create a isolate to calculate, but this led to yet another problem: unable to call in the isolate UI related functions, such as: TextPainter.layout(...).

Steps to Reproduce

  1. Run flutter create bug.
  2. Update the files as follows: ...
  3. Use the TextPainter.layout(...) function on a isolate

Expected results: Able to run TextPainter.layout(...) function in a new isolate

Actual results: UI actions are only available on root isolate

Logs
> E/flutter (28001): UI actions are only available on root isolate.
> E/flutter (28001): #0      PlatformDispatcher._nativeSetNeedsReportTimings (dart:ui/platform_dispatcher.dart:369:59)
> E/flutter (28001): #1      PlatformDispatcher.
> E/flutter (28001): #2      SingletonFlutterWindow.
> E/flutter (28001): #3      SchedulerBinding.addTimingsCallback (package:flutter/src/scheduler/binding.dart:269:14)
> E/flutter (28001): #4      SchedulerBinding.initInstances (package:flutter/src/scheduler/binding.dart:206:7)
> E/flutter (28001): #5      ServicesBinding.initInstances (package:flutter/src/services/binding.dart:27:11)
> E/flutter (28001): #6      PaintingBinding.initInstances (package:flutter/src/painting/binding.dart:22:11)
> E/flutter (28001): #7      SemanticsBinding.initInstances (package:flutter/src/semantics/binding.dart:22:11)
> E/flutter (28001): #8      RendererBinding.initInstances (package:flutter/src/rendering/binding.dart:28:11)
> E/flutter (28001): #9      WidgetsBinding.initInstances (package:flutter/src/widgets/binding.dart:277:11)
> E/flutter (28001): #10     new BindingBase (package:flutter/src/foundation/binding.dart:56:5)
> E/flutter (28001): #11     new _WidgetsFlutterBinding&BindingBase&GestureBinding (package:flutter/src/widgets/binding.dart)
> E/flutter (28001): #12     new _WidgetsFlutterBinding&BindingBase&GestureBinding&SchedulerBinding (package:flutter/src/widgets/binding.dart)
> E/flutter (28001): #13     new _WidgetsFlutterBinding&BindingBase&GestureBinding&SchedulerBinding&ServicesBinding (package:flutter/src/widgets/binding.dart)
> E/flutter (28001): #14     new _WidgetsFlutterBinding&BindingBase&GestureBinding&SchedulerBinding&ServicesBinding&PaintingBinding (package:flutter/src/widgets/binding.dart)
> E/flutter (28001): #15     new _WidgetsFlutterBinding&BindingBase&GestureBinding&SchedulerBinding&ServicesBinding&PaintingBinding&SemanticsBinding (package:flutter/src/widgets/binding.dart)
> E/flutter (28001): #16     new _WidgetsFlutterBinding&BindingBase&GestureBinding&SchedulerBinding&ServicesBinding&PaintingBinding&SemanticsBinding&RendererBinding (package:flutter/src/widgets/binding.dart)
> E/flutter (28001): #17     new _WidgetsFlutterBinding&BindingBase&GestureBinding&SchedulerBinding&ServicesBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding (package:flutter/src/widgets/binding.dart)
> E/flutter (28001): #18     new WidgetsFlutterBinding (package:flutter/src/widgets/binding.dart)
> E/flutter (28001): #19     WidgetsFlutterBinding.ensureInitialized (package:flutter/src/widgets/binding.dart:1237:7)
> E/flutter (28001): #20     _fileDataHandler.<anonymous closure> (package:ghome_toolkit/common/ui/pages/file_preview.dart:82:27)
> E/flutter (28001): #21     _RootZone.runUnaryGuarded (dart:async/zone.dart:1546:10)
> E/flutter (28001): #22     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
> E/flutter (28001): #23     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
> E/flutter (28001): #24     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)
> E/flutter (28001): #25     _StreamController._add (dart:async/stream_controller.dart:607:7)
> E/flutter (28001): #26     _StreamController.add (dart:async/stream_controller.dart:554:5)
> E/flutter (28001): #27     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
Analyzing ghome_toolkit...                                      

   info - Unused import: 'package:ghome_toolkit/common/ui/utils/simple_utils.dart' - lib\common\ui\pages\file_preview.dart:7:8 - unused_import
warning - The receiver can't be null because of short-circuiting, so the null-aware operator '?.' can't be used - lib\controller\guid\guid_controller.dart:250:54 - invalid_null_aware_operator
warning - The receiver can't be null because of short-circuiting, so the null-aware operator '?.' can't be used - lib\controller\guid\guid_controller.dart:250:62 - invalid_null_aware_operator
warning - The receiver can't be null because of short-circuiting, so the null-aware operator '?.' can't be used - lib\controller\guid\guid_controller.dart:250:70 - invalid_null_aware_operator
   info - Unused import: 'package:flutter/material.dart' - lib\model\guid\error_model.dart:1:8 - unused_import
   info - The name ParagraphBuilder is shown, but isn’t used - lib\page\guid\guid_page.dart:6:29 - unused_shown_name
   info - Unused import: 'package:flutter/material.dart' - test\widget_test.dart:8:8 - unused_import
   info - Unused import: 'package:ghome_toolkit/main.dart' - test\widget_test.dart:11:8 - unused_import


[√] Flutter (Channel stable, 2.0.2, on Microsoft Windows [Version 10.0.17763.1757], locale zh-CN)
    • Flutter version 2.0.2 at C:\wuchaochao\flutter\tools\flutter
    • Framework revision 8962f6dc68 (3 weeks ago), 2021-03-11 13:22:20 -0800
    • Engine revision 5d8bf811b3
    • Dart version 2.12.1
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\wuchaochao\AppData\Local\Android\sdk
    • Platform android-30, build-tools 29.0.2
    • Java binary at: C:\wuchaochao\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Users\wuchaochao\AppData\Local\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.0)
    • Android Studio at C:\wuchaochao\Android\Android Studio
    • Flutter plugin version 51.0.1
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] Connected device (2 available)
    • M6 Note (mobile) • 721QADRR45FUF • android-arm64  • Android 7.1.2 (API 25)
    • Chrome (web)     • chrome        • web-javascript • Google Chrome 87.0.4280.66

• No issues found!

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Mar 30, 2021
@darshankawar
Copy link
Member

@ModWU
I think since you are trying to open from new isolate other than from root, which isn't possible at the moment and hence the error which says UI actions are only available on root isolate. See this open issue for further reference : #10647

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 30, 2021
@ModWU
Copy link
Author
ModWU commented Mar 30, 2021

@ModWU
I think since you are trying to open from new isolate other than from root, which isn't possible at the moment and hence the error which says UI actions are only available on root isolate. See this open issue for further reference : #10647

I have browsed this issue, but could not find a solution.

@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 Mar 30, 2021
@darshankawar
Copy link
Member

@ModWU
Well, the original issue is still open. I suggest you to upvote the original issue and comment on it with your above findings in it.
I am going ahead and closing this as duplicate in favor of #10647. If you disagree, write in comments and I'll reopen it.
Thanks.

@darshankawar darshankawar added r: duplicate Issue is closed as a duplicate of an existing issue and removed in triage Presently being triaged by the triage team labels Mar 30, 2021
@github-actions
Copy link
github-actions bot commented Aug 3, 2021

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 -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: duplicate Issue is closed as a duplicate of an existing issue
Projects
None yet
Development

No branches or pull requests

2 participants
0