philiplinden / bevy-jam-5

a bullet hell rhythm game created for Bevy Jam #5 with the theme: cycles
MIT License
4 stars 1 forks source link

Immediate crash in packaged macOS build #16

Open rparrett opened 2 months ago

rparrett commented 2 months ago

This manifests as a user double-clicking the app, and the app "opening" but immediately closing before a window is even created.

If you run the app from the terminal exactly like this:

open bevy-jam-5.app/Contents/MacOS/bevy-jam-5

You can see the panic causing the issue:


2024-08-03T17:05:23.533184Z  INFO bevy_winit::system: Creating new window "[ p h a s e ~ s h i f t ]" (Entity { index: 0, generation: 1 })
thread 'main' panicked at src/ui/mod.rs:43:14:
Failed to open icon path: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_jam_5::ui::set_window_icon`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!
``
janhohenheim commented 2 months ago

Relevant code: image

I assumed that you simply forgot to package the icon, but no: image

This seems to be related to loading the icon manually without the asset server.

rparrett commented 2 months ago

I suspect you can work around this by using https://docs.rs/bevy/latest/bevy/asset/io/file/struct.FileAssetReader.html#method.get_base_path