You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The main windows auto-closes immediately after start for WRY template when run on Windows.
Steps To Reproduce
cargo mobile init
# choose option 6 for WRY# I did run `cargo mobile run` here, not sure if that matters
cargo run
# observe window opens then closes within a second. The application continues to run
Note: cargo mobile run works as expected - the app stays open in android emulator
Expected behavior cargo run should open the main window with the content, and the window should remain open, until explicitly closed
Screenshots
window auto-closes
Platform and Versions (please complete the following information):
Host OS: Windows 11
Target OS:
Rustc:
Ouput of cargo mobile doctor:
Potential solution
The template on https://github.com/tauri-apps/wry is different from the one included in cargo mobile2. Specifically the window initialization logic is done outside of the event loop.
Moving build_webview from the event loop allows to run the app correctly on both Android and Windows:
Describe the bug
The main windows auto-closes immediately after start for WRY template when run on Windows.
Steps To Reproduce
Note:
cargo mobile run
works as expected - the app stays open in android emulatorExpected behavior
cargo run
should open the main window with the content, and the window should remain open, until explicitly closedScreenshots
window auto-closes
Platform and Versions (please complete the following information):
Host OS: Windows 11
Target OS:
Rustc:
Ouput of
cargo mobile doctor
:Additional context
Default settings, latest cargo mobile2.
Potential solution
The template on https://github.com/tauri-apps/wry is different from the one included in cargo mobile2. Specifically the window initialization logic is done outside of the event loop.
Moving
build_webview
from the event loop allows to run the app correctly on both Android and Windows:The text was updated successfully, but these errors were encountered: