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
android - fix issues other than the rendering (bevyengine#5130)
# Objective
- Make Bevy work on android
## Solution
- Update android metadata and add a few more
- Set the target sdk to 31 as it will soon (in august) be the minimum sdk level for play store
- Remove the custom code to create an activity and use ndk-glue macro instead
- Delay window creation event on android
- Set the example with compatibility settings for wgpu. Those are needed for Bevy to work on my 2019 android tablet
- Add a few details on how to debug in case of failures
- Fix running the example on emulator. This was failing because of the name of the example
Bevy still doesn't work on android with this, audio features need to be disabled because of an ndk-glue version mismatch: rodio depends on 0.6.2, winit on 0.5.2. You can test with:
```
cargo apk run --release --example android_example --no-default-features --features "bevy_winit,render"
```
Please reference `cargo-apk`[README](https://crates.io/crates/cargo-apk) for other Android Manifest fields.
364
363
364
+
### Debugging
365
+
366
+
You can view the logs with the following command:
367
+
368
+
```sh
369
+
adb logcat | grep 'RustStdoutStderr\|bevy\|wgpu'
370
+
```
371
+
372
+
In case of an error getting a GPU or setting it up, you can try settings logs of `wgpu_hal` to `DEBUG` to get more informations.
373
+
374
+
Sometimes, running the app complains about an unknown activity. This may be fixed by uninstalling the application:
375
+
376
+
```sh
377
+
adb uninstall org.bevyengine.example
378
+
```
379
+
365
380
### Old phones
366
381
367
-
Bevy by default targets Android API level 29 in its examples which is the <!-- markdown-link-check-disable -->
382
+
Bevy by default targets Android API level 31 in its examples which is the <!-- markdown-link-check-disable -->
368
383
[Play Store's minimum API to upload or update apps](https://developer.android.com/distribute/best-practices/develop/target-sdk). <!-- markdown-link-check-enable -->
369
384
Users of older phones may want to use an older API when testing.
370
385
371
386
To use a different API, the following fields must be updated in Cargo.toml:
Please reference `cargo-apk` [README](https://crates.io/crates/cargo-apk) for other Android Manifest fields.
116
115
116
+
### Debugging
117
+
118
+
You can view the logs with the following command:
119
+
120
+
```sh
121
+
adb logcat | grep 'RustStdoutStderr\|bevy\|wgpu'
122
+
```
123
+
124
+
In case of an error getting a GPU or setting it up, you can try settings logs of `wgpu_hal` to `DEBUG` to get more informations.
125
+
126
+
Sometimes, running the app complains about an unknown activity. This may be fixed by uninstalling the application:
127
+
128
+
```sh
129
+
adb uninstall org.bevyengine.example
130
+
```
131
+
117
132
### Old phones
118
133
119
-
Bevy by default targets Android API level 29 in its examples which is the <!-- markdown-link-check-disable -->
134
+
Bevy by default targets Android API level 31 in its examples which is the <!-- markdown-link-check-disable -->
120
135
[Play Store's minimum API to upload or update apps](https://developer.android.com/distribute/best-practices/develop/target-sdk). <!-- markdown-link-check-enable -->
121
136
Users of older phones may want to use an older API when testing.
122
137
123
138
To use a different API, the following fields must be updated in Cargo.toml:
0 commit comments