Skip to content

Undefined name 'platformViewRegistry' #2291

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
1 of 5 tasks
peilinok opened this issue Apr 24, 2025 · 7 comments
Open
1 of 5 tasks

Undefined name 'platformViewRegistry' #2291

peilinok opened this issue Apr 24, 2025 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@peilinok
Copy link
Contributor

Version of the agora_rtc_engine

6.5.x 6.3.x

Platforms affected

  • Android
  • iOS
  • macOS
  • Windows
  • Web

Steps to reproduce

#2273

Expected results

no error

Actual results

from @arthurbcd

The ui.platformViewRegistry (currently deprecated) will be removed on the next flutter stable release.
Which throws:
Error: Undefined name 'platformViewRegistry'.
The solution is to use dart:ui_web instead of dart:ui, both available in flutter.

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]
@peilinok
Copy link
Contributor Author

by @arthurbcd
#2273

revert in
#2290

@peilinok peilinok self-assigned this Apr 24, 2025
@peilinok peilinok added the bug Something isn't working label Apr 24, 2025
@elihaialgoaitech
Copy link

HI. I got that issue on flutter web 3.32.0
I hope it will be fixed soon

@tototo23
Copy link

Same here, some plugins used it (flutter_super_html_viewer) and it doesnt work anymore on the web :

html_content_viewer_widget_web.dart:261:8: Error: Undefined name 'platformViewRegistry'.
    ui.platformViewRegistry
       ^^^^^^^^^^^^^^^^^^^^

@maple135790
Copy link

maple135790 commented May 28, 2025

I think i found a solution. Simply change import dart:ui as ui; to import 'dart:ui_web' as ui; in /lib/src/impl/platform/web/global_video_view_controller_platform_web.dart
Not sure why this does not cause any problems before.

working on PR

@maple135790
Copy link

As mentioned in #2290

This has been fixed before, but sadly, since the separation of dart:ui and dart:ui_web was introduced in flutter 3.13.0, this fix won't meet the bottom requirement 3.0.0.

For users on ^3.32.0, following the fix in 77b68ae and saving it locally should work.

@peilinok
Copy link
Contributor Author

@maple135790 Thank you very much for your summary. We will schedule an upgrade for compatibility versions and fix this issue in the near future.

@peilinok
Copy link
Contributor Author

As mentioned in #2290

This has been fixed before, but sadly, since the separation of dart:ui and dart:ui_web was introduced in flutter 3.13.0, this fix won't meet the bottom requirement 3.0.0.

For users on ^3.32.0, following the fix in 77b68ae and saving it locally should work.

Hi @elihaialgoaitech @tototo23 , If you need to work with the latest Flutter version, we recommend forking a private repository and cherry-picking the fix commit as a temporary solution. We will notify you once we complete the compatibility upgrade in our main repository.

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

No branches or pull requests

4 participants