Remove android game activity from default (#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>
This commit is contained in:
Christian Oelschlegel
2026-04-28 22:39:04 +02:00
committed by GitHub
parent a53622219e
commit f6ff3c334e
8 changed files with 28 additions and 37 deletions
-1
View File
@@ -184,7 +184,6 @@ default_app = [
# COLLECTION: These are platform support features, such as OS support/features, windowing and input backends, etc.
default_platform = [
"std",
"android-game-activity",
"bevy_gilrs",
"bevy_winit",
# Note: OS-integrated clipboard support is gated behind the `system_clipboard` feature,
@@ -0,0 +1,22 @@
---
title: "Remove android game activity from default"
pull_requests: [23708]
---
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.
Now both activities are not part of the default features but need to be added explicitly.
**Migration from bevy 0.18 to 0.19:**
For apps using `GameActivity` you need to add the feature `"android-game-activity"` to your `Cargo.toml`:
```toml
bevy = { version = "0.19", features = ["android-game-activity"] }
```
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:
```toml
bevy = { version = "0.19", features = ["android-native-activity"] }
```
+1 -1
View File
@@ -156,7 +156,7 @@ Keep in mind that if you are using `bevy_audio` the minimum supported Android AP
To use `NativeActivity`, you need to edit it in `cargo.toml` manually like this:
```toml
bevy = { version = "0.19", default-features = false, features = ["android-native-activity", ...] }
bevy = { version = "0.19", features = ["android-native-activity"] }
```
Then build it as the [Build & Run](#build--run) section stated above.
+1 -1
View File
@@ -42,7 +42,7 @@ collections to build your own "profile" equivalent, without needing to manually
|scene|Features used to compose Bevy scenes. **Feature set:** `bevy_world_serialization`, `bevy_scene`.|
|picking|Enables picking with all backends. **Feature set:** `bevy_picking`, `mesh_picking`, `sprite_picking`, `ui_picking`.|
|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`.|
|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`.|
|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`.|
|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`.|
|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`.|
|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`.|
+1 -1
View File
@@ -766,7 +766,7 @@ Keep in mind that if you are using `bevy_audio` the minimum supported Android AP
To use `NativeActivity`, you need to edit it in `cargo.toml` manually like this:
```toml
bevy = { version = "0.19", default-features = false, features = ["android-native-activity", ...] }
bevy = { version = "0.19", features = ["android-native-activity"] }
```
Then build it as the [Build & Run](#build--run) section stated above.
+1 -1
View File
@@ -12,7 +12,7 @@ name = "bevy_mobile_example"
crate-type = ["lib", "cdylib"]
[dependencies]
bevy = { path = "../../" }
bevy = { path = "../../", features = ["android-game-activity"] }
[lints]
workspace = true
+1 -31
View File
@@ -12,37 +12,7 @@ name = "bevy_mobile_example"
crate-type = ["staticlib", "cdylib"]
[dependencies]
bevy = { path = "../../", default-features = false, features = [
"android-native-activity",
"gltf_animation",
"bevy_animation",
"bevy_asset",
"bevy_audio",
"bevy_color",
"bevy_core_pipeline",
"bevy_gilrs",
"bevy_gizmos",
"bevy_gltf",
"bevy_pbr",
"bevy_render",
"bevy_world_serialization",
"bevy_sprite",
"bevy_state",
"bevy_text",
"bevy_ui",
"bevy_winit",
"default_font",
"hdr",
"ktx2",
"multi_threaded",
"png",
"sysinfo_plugin",
"tonemapping_luts",
"vorbis",
"webgl2",
"x11",
"zstd",
] }
bevy = { path = "../../", features = ["android-native-activity"] }
[package.metadata.android]
package = "org.bevyengine.example"
+1 -1
View File
@@ -16,7 +16,7 @@ Please refer example [README](../../README.md#setup) for NDK/SDK related instruc
When using `cargo-apk`, it must use `NativeActivity`, so you need to edit it in `Cargo.toml` manually like this:
```toml
bevy = { version = "0.14", default-features = false, features = ["android-native-activity", ...] }
bevy = { version = "0.19", features = ["android-native-activity"] }
```
Then the following fields must be added to `Cargo.toml`: