don't create windows on winit StartCause::Init event (#9684)

# Objective

- https://github.com/bevyengine/bevy/pull/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
This commit is contained in:
François 2023-09-23 08:28:49 +02:00 committed by GitHub
parent 0181d40d83
commit b416d181a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -366,7 +366,7 @@ pub fn winit_runner(mut app: App) {
match event {
event::Event::NewEvents(start_cause) => match start_cause {
StartCause::Init => {
#[cfg(any(target_os = "android", target_os = "ios", target_os = "macos"))]
#[cfg(any(target_os = "ios", target_os = "macos"))]
{
#[cfg(not(target_arch = "wasm32"))]
let (