Skip to content
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

macOS: PlatformException on Hot Restart #2405

Open
1 of 2 tasks
ToniTornado opened this issue Nov 7, 2024 · 3 comments
Open
1 of 2 tasks

macOS: PlatformException on Hot Restart #2405

ToniTornado opened this issue Nov 7, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ToniTornado
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When I run the example application on macOS and perform a hot restart, I get the following exception:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(recreating_view, trying to create an already created view, view id: '0', null)

Expected Behavior

The widget tree is rebuilt and a fresh instance of InAppWebView is created without throwing an exception.

Steps with code example to reproduce

Steps with code example to reproduce
// Paste your code here

Stacktrace/Logs

Stacktrace/Logs
<Replace this line by pasting your stacktrace or logs here>

Flutter version

3.24.4

Operating System, Device-specific and/or Tool

macOS

Plugin version

6.2.0-beta.1

Additional information

No response

Self grab

  • I'm ready to work on this issue!
@ToniTornado ToniTornado added the bug Something isn't working label Nov 7, 2024
@pichillilorenzo
Copy link
Owner

pichillilorenzo commented Nov 7, 2024

For unknown reasons, the Flutter PlatformView is not disposed automatically on Hot Restart.
It works as expected on Android, iOS, and Windows but not on macOS.
I think this has something to do with how Flutter manages the native PlatformView under the hood as this plugin is using the Flutter official API to render native views.
Probably, you should open an issue on the Flutter official repo and you can mention this issue.

@hhcme
Copy link

hhcme commented Nov 22, 2024

I also found similar issues in my project

@giorgiogross
Copy link

Experiencing the same issue; wasn't aware it only happens on hot restart but a full rebuild helps

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