Skip to content

Commit b2060f9

Browse files
oelisonChristian Oelschlegelleomeinel
authored andcommitted
Remove android game activity from default (bevyengine#23708)
android handle only one activity, either game or native. To use native, the default could now be used, but all other android need to add the game activity. # Objective android native activities should be able to use the default ## Solution remove android-game-activity from default ## Testing created a default app for android native activity with default ## Important Will be a breaking change for apps using android-game-activity. --------- Co-authored-by: Christian Oelschlegel <oelschle@sciphy.de> Co-authored-by: leomeinel <leo@meinel.dev>
1 parent 82a1c5f commit b2060f9

8 files changed

Lines changed: 28 additions & 37 deletions

File tree

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ default_app = [
184184
# COLLECTION: These are platform support features, such as OS support/features, windowing and input backends, etc.
185185
default_platform = [
186186
"std",
187-
"android-game-activity",
188187
"bevy_gilrs",
189188
"bevy_winit",
190189
# Note: OS-integrated clipboard support is gated behind the `system_clipboard` feature,
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: "Remove android game activity from default"
3+
pull_requests: [23708]
4+
---
5+
6+
Bevy previously had `"android-game-activity"` as part of its default features. Users that wanted to use "android-native-activity" instead, had to disable `default-features` and define all features + "android-native-activity" explicitly since they can't have both activity features at once.
7+
8+
Now both activities are not part of the default features but need to be added explicitly.
9+
10+
**Migration from bevy 0.18 to 0.19:**
11+
12+
For apps using `GameActivity` you need to add the feature `"android-game-activity"` to your `Cargo.toml`:
13+
14+
```toml
15+
bevy = { version = "0.19", features = ["android-game-activity"] }
16+
```
17+
18+
Since apps using `NativeActivity` already define features explicitly, you don't have to necessarily make changes. If you want to use the default features instead, you can now just add the feature `"android-native-activity"` to your `Cargo.toml` instead of redefining features explicitly:
19+
20+
```toml
21+
bevy = { version = "0.19", features = ["android-native-activity"] }
22+
```

docs-template/EXAMPLE_README.md.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ Keep in mind that if you are using `bevy_audio` the minimum supported Android AP
156156
To use `NativeActivity`, you need to edit it in `cargo.toml` manually like this:
157157

158158
```toml
159-
bevy = { version = "0.19", default-features = false, features = ["android-native-activity", ...] }
159+
bevy = { version = "0.19", features = ["android-native-activity"] }
160160
```
161161

162162
Then build it as the [Build & Run](#build--run) section stated above.

docs/cargo_features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ collections to build your own "profile" equivalent, without needing to manually
4242
|scene|Features used to compose Bevy scenes. **Feature set:** `bevy_world_serialization`, `bevy_scene`.|
4343
|picking|Enables picking with all backends. **Feature set:** `bevy_picking`, `mesh_picking`, `sprite_picking`, `ui_picking`.|
4444
|default_app|The core pieces that most apps need. This serves as a baseline feature set for other higher level feature collections (such as "2d" and "3d"). It is also useful as a baseline feature set for scenarios like headless apps that require no rendering (ex: command line tools, servers, etc). **Feature set:** `async_executor`, `bevy_asset`, `bevy_input_focus`, `bevy_log`, `bevy_state`, `bevy_window`, `custom_cursor`, `reflect_auto_register`.|
45-
|default_platform|These are platform support features, such as OS support/features, windowing and input backends, etc. **Feature set:** `std`, `android-game-activity`, `bevy_gilrs`, `bevy_winit`, `bevy_clipboard`, `default_font`, `multi_threaded`, `webgl2`, `x11`, `wayland`, `sysinfo_plugin`.|
45+
|default_platform|These are platform support features, such as OS support/features, windowing and input backends, etc. **Feature set:** `std`, `bevy_gilrs`, `bevy_winit`, `bevy_clipboard`, `default_font`, `multi_threaded`, `webgl2`, `x11`, `wayland`, `sysinfo_plugin`.|
4646
|common_api|Default scene definition features. Note that this does not include an actual renderer, such as bevy_render (Bevy's default render backend). **Feature set:** `bevy_animation`, `bevy_camera`, `bevy_color`, `bevy_gizmos`, `bevy_image`, `bevy_mesh`, `bevy_shader`, `bevy_material`, `bevy_text`, `hdr`, `png`.|
4747
|2d_api|Features used to build 2D Bevy apps (does not include a render backend). You generally don't need to worry about this unless you are using a custom renderer. **Feature set:** `common_api`, `bevy_sprite`.|
4848
|2d_bevy_render|Bevy's built-in 2D renderer, built on top of `bevy_render`. **Feature set:** `2d_api`, `bevy_render`, `bevy_core_pipeline`, `bevy_post_process`, `bevy_sprite_render`, `bevy_gizmos_render`.|

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ Keep in mind that if you are using `bevy_audio` the minimum supported Android AP
766766
To use `NativeActivity`, you need to edit it in `cargo.toml` manually like this:
767767

768768
```toml
769-
bevy = { version = "0.19", default-features = false, features = ["android-native-activity", ...] }
769+
bevy = { version = "0.19", features = ["android-native-activity"] }
770770
```
771771

772772
Then build it as the [Build & Run](#build--run) section stated above.

examples/mobile/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ name = "bevy_mobile_example"
1212
crate-type = ["lib", "cdylib"]
1313

1414
[dependencies]
15-
bevy = { path = "../../" }
15+
bevy = { path = "../../", features = ["android-game-activity"] }
1616

1717
[lints]
1818
workspace = true

examples/mobile/android_basic/Cargo.toml

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,7 @@ name = "bevy_mobile_example"
1212
crate-type = ["staticlib", "cdylib"]
1313

1414
[dependencies]
15-
bevy = { path = "../../", default-features = false, features = [
16-
"android-native-activity",
17-
"gltf_animation",
18-
"bevy_animation",
19-
"bevy_asset",
20-
"bevy_audio",
21-
"bevy_color",
22-
"bevy_core_pipeline",
23-
"bevy_gilrs",
24-
"bevy_gizmos",
25-
"bevy_gltf",
26-
"bevy_pbr",
27-
"bevy_render",
28-
"bevy_world_serialization",
29-
"bevy_sprite",
30-
"bevy_state",
31-
"bevy_text",
32-
"bevy_ui",
33-
"bevy_winit",
34-
"default_font",
35-
"hdr",
36-
"ktx2",
37-
"multi_threaded",
38-
"png",
39-
"sysinfo_plugin",
40-
"tonemapping_luts",
41-
"vorbis",
42-
"webgl2",
43-
"x11",
44-
"zstd",
45-
] }
15+
bevy = { path = "../../", features = ["android-native-activity"] }
4616

4717
[package.metadata.android]
4818
package = "org.bevyengine.example"

examples/mobile/android_basic/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Please refer example [README](../../README.md#setup) for NDK/SDK related instruc
1616
When using `cargo-apk`, it must use `NativeActivity`, so you need to edit it in `Cargo.toml` manually like this:
1717

1818
```toml
19-
bevy = { version = "0.14", default-features = false, features = ["android-native-activity", ...] }
19+
bevy = { version = "0.19", features = ["android-native-activity"] }
2020
```
2121

2222
Then the following fields must be added to `Cargo.toml`:

0 commit comments

Comments
 (0)