Skip to content

Conversation

@mockersf
Copy link
Member

@mockersf mockersf commented Sep 3, 2023

Objective

8721  8770 I event crates/bevy_winit/src/system.rs:55:  Creating new window "App" (0v0)
8721  8769 I RustStdoutStderr: thread '<unnamed>' panicked at 'Cannot get the native window, it's null and will always be null before Event::Resumed and after Event::Suspended. Make sure you only call this function between those events.', winit-0.28.6/src/platform_impl/android/mod.rs:1058:13

Solution

  • Don't create windows on StartCause::Init as it's too early

@mockersf mockersf added A-Windowing Platform-agnostic interface layer to run your app in O-Android Specific to the Android mobile operating system labels Sep 3, 2023
@mockersf mockersf added this to the 0.12 milestone Sep 7, 2023
alexgeek added a commit to alexgeek/bevy that referenced this pull request Sep 13, 2023
@mockersf
Copy link
Member Author

changed to just not impact Android

@mockersf mockersf requested a review from maniwani September 22, 2023 22:04
Copy link
Contributor

@maniwani maniwani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, whoops.

I think somewhere I picked up the wrong impression that a window needed to exist before the first app update and that it was preferable to make one in StartCause::Init, but I guess not.

@james7132 james7132 added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Sep 23, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Sep 23, 2023
Merged via the queue into bevyengine:main with commit b416d18 Sep 23, 2023
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
# Objective

- bevyengine#7609 broke Android support

```
8721  8770 I event crates/bevy_winit/src/system.rs:55:  Creating new window "App" (0v0)
8721  8769 I RustStdoutStderr: thread '<unnamed>' panicked at 'Cannot get the native window, it's null and will always be null before Event::Resumed and after Event::Suspended. Make sure you only call this function between those events.', winit-0.28.6/src/platform_impl/android/mod.rs:1058:13
```
## Solution

- Don't create windows on `StartCause::Init` as it's too early
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Windowing Platform-agnostic interface layer to run your app in O-Android Specific to the Android mobile operating system S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants