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

bevy mobile example crashes on Android #13331

Open
FabianZeuner opened this issue May 11, 2024 · 2 comments · May be fixed by #13366
Open

bevy mobile example crashes on Android #13331

FabianZeuner opened this issue May 11, 2024 · 2 comments · May be fixed by #13366
Labels
C-Crash A sudden unexpected crash C-Dependencies A change to the crates that Bevy depends on O-Android Specific to the Android mobile operating system S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Milestone

Comments

@FabianZeuner
Copy link

FabianZeuner commented May 11, 2024

Developing on:

  • Ubuntu 22.04
  • rustup 1.27.1
  • rust 1.78.0 nightly
  • cargo 1.78.0
  • adb 1.0.41
  • javac 11.0.22
  • java 11.0.22
  • gradle 8.7

Building for device:

  • Samsung Galaxy Note20 5G
  • Android version: 13

I'm trying run the bevy mobile example on my android phone.

What I do:

  • I clone bevy repository from GitHub and follow the instructions how to setup and run the example on Android.
  • Run cargo apk run -p bevy_mobile_example in the repository root directory.
  • Apk is build successfully and installed to my device.
  • The app opens and shows a splash screen with bevy logo for a second before the app closes.

The first lines of output are:

--------- beginning of crash
05-11 22:18:50.644 15057 15057 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 15057 (yengine.example), pid 15057 (yengine.example)
05-11 22:18:50.662 15057 15165 I RustStdoutStderr: thread '<unnamed>' panicked at library/core/src/panicking.rs:156:5:
05-11 22:18:50.663 15057 15165 I RustStdoutStderr: unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`
05-11 22:18:50.663 15057 15165 I RustStdoutStderr: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
05-11 22:18:50.663 15057 15165 I RustStdoutStderr: thread caused non-unwinding panic. aborting.

I also tried building bevy with xbuild and with other target sdk (32, 33), but with the same result.

@FabianZeuner FabianZeuner added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels May 11, 2024
@mockersf
Copy link
Member

This is due to rust-mobile/android-activity#153

It should be fixed by updating winit.

As a workaround, you can use either rust 1.77 or nightly-2024-02-08

@mockersf mockersf added C-Crash A sudden unexpected crash C-Dependencies A change to the crates that Bevy depends on O-Android Specific to the Android mobile operating system and removed C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels May 11, 2024
@mockersf mockersf added this to the 0.14 milestone May 11, 2024
@alice-i-cecile alice-i-cecile linked a pull request May 16, 2024 that will close this issue
8 tasks
@alice-i-cecile alice-i-cecile added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label May 16, 2024
@blaind
Copy link
Contributor

blaind commented May 17, 2024

Another workaround: patching android-activity in Cargo.toml and modifying it with the following commit: https://github.com/rust-mobile/android-activity/pull/157/files

github-merge-queue bot pushed a commit that referenced this issue May 17, 2024
…3413)

# Objective

- Rust 1.78 breaks all Android support, see
#13331
- We should not bump the MSRV to 1.78 until that's resolved in #13366.

## Solution

- Temporarily revert #13347

Co-authored-by: Alice Cecile <alice.i.cecil@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Crash A sudden unexpected crash C-Dependencies A change to the crates that Bevy depends on O-Android Specific to the Android mobile operating system S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants