Skip to content

Remove android game activity from default#23708

Open
oelison wants to merge 1 commit intobevyengine:mainfrom
oelison:remove_android_game
Open

Remove android game activity from default#23708
oelison wants to merge 1 commit intobevyengine:mainfrom
oelison:remove_android_game

Conversation

@oelison
Copy link
Copy Markdown

@oelison oelison commented Apr 7, 2026

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Welcome, new contributor!

Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨

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.
@oelison oelison force-pushed the remove_android_game branch from eee383b to d7fe52a Compare April 7, 2026 19:23
@mockersf mockersf added the O-Android Specific to the Android mobile operating system label Apr 7, 2026
@leomeinel
Copy link
Copy Markdown
Contributor

I'm not sure if I might be misunderstanding your description, but as far as I know, the android-native-activity feature is still required if using NativeActivtiy. If we just remove android-game-activity from the defaults, one would always have to add one of the activity features to be able to build for android at all.

Is that what this PR wants to achieve to make it simpler to use android-native-activity?

@oelison
Copy link
Copy Markdown
Author

oelison commented Apr 8, 2026

Yes. If one of them is set, the default is not usable anymore, because both can not be set.
My minimum Cargo.toml is

[package]
name = "my_bevy_start"
version = "0.1.0"
edition = "2024"
license = "MIT OR Apache-2.0"
repository = "https://github.com/oelison/my_bevy_start"
publish = false

# common (desktop / linux) features
[dependencies]
bevy_ecs = "0.18.0"
bevy_gizmos = "0.18.0"
bevy_mod_openxr = { version = "0.5.0", features = [
    "window_support",
    "fb_passthrough",
] }
bevy_mod_xr = "0.5.0"
bevy_xr_utils = "0.5.0"
openxr = "0.21.1"
schminput = { version = "0.5.0", features = ["xr"] }

[target.'cfg(not(target_os = "android"))'.dependencies]
audio = "0.2.1"
bevy = {version = "0.18.0" }

[target.'cfg(target_os = "android")'.dependencies]
# Android-only features (won't be compiled on Linux)
bevy = { version = "0.18", default-features = false, features = [
    "android-native-activity",
    "android_shared_stdcxx",
    "default_app",
    "std",
    "default_font",
    "multi_threaded",
    "sysinfo_plugin",
    "2d_bevy_render",
    "scene",
    "audio",
    "picking",
    "3d_bevy_render",
    "ui_api",
    "ui_bevy_render",
] }

[build-dependencies]
reqwest = { version = "0.12", features = ["blocking"] }
zip = "2.1"

[lib]
name="my_bevy_start"
crate-type = ["rlib", "cdylib"]

#[[bin]]
#path="src/lib.rs"
#name="my_bevy_start"

There is a lot differences between android XR app and a Linux/Windows app. There fore it should be better to remove the android-game-activity and manually add one of the android-native-activity or the android-game-activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-Android Specific to the Android mobile operating system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants