examples: Use single up-to-date android example#23491
examples: Use single up-to-date android example#23491leomeinel wants to merge 23 commits intobevyengine:mainfrom
Conversation
8d26f08 to
b424cfa
Compare
b424cfa to
a3ffcd6
Compare
a3ffcd6 to
bdbace9
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
3ee40f5 to
9ad8fb2
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
7007739 to
d6ac06a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
|
glad to see updates on android! I just followed the java one before when I was making that update though, I'm favor to kotlin too for libc++_shared, iirc it's required for also about |
This comment was marked as resolved.
This comment was marked as resolved.
|
I believe |
I assumed at first that the table was under the About `cargo-apk` heading for Android, therefore I removed it at first. Now I moved it directly under the Android heading which makes a lot more sense in my opinion. The same has been done with the ios table for consistency. Additionally this uses mobile as the example identifier since the mentioned file is not platform specific in the table.
This also includes a rebuild.
This has been tested and is working.
This also fixes a nullpointer exception in hideSystemUi that has been observed on Android API 28 (Samsung Galaxy J3)
0fa5d84 to
5b85919
Compare
|
@mockersf wants to review this before we merge. It'll be a while, but he will get to it and we will get this in in some form :) I'm going to defer to him on this since my Android expertise is minimal. |
Perfect, I'm glad that people are interested in this and am very happy about all interactions here. I'm just about to submit the changes you requested, not sure if they are okay like that though :D |
This merges changes relevant to 0.18.1 from bevyengine/bevy#23491 It additionally updates targetSdk and compileSdk which I will later do in that PR.
Objective
Problems with current examples
GameActivityandcargo-ndk. It is confusing and unnecessary to do it any other way in my opinion.GameActivitywhich is incorrect. It should be 23.Solution
./examples/mobile/androidlibs.versions.tomlgradle-daemon-jvm.propertiesgenerated with./gradlew updateDaemonJvm./assets/android-res/mipmap-mdpi/ic_launcher.pngto/examples/mobile/android/app/src/main/res/mipmap/ic_launcher.pngbecause that is where ic_launcher mipmaps are located by default.targetSdk = 36andcompileSdk = 36and explain inexamples/README.mdGameActivity.Testing
Screenshots
NativeActivity
GameActivity
Working Devices (GameActivity and NativeActivity)
Environment
cargo: 1.94.0
cargo-ndk: 4.1.2
Kernel:
Linux <redacted> 6.18.20-1-lts #1 SMP PREEMPT_DYNAMIC Wed, 25 Mar 2026 12:17:34 +0000 x86_64 GNU/Linuxkvm filename:
/lib/modules/6.18.20-1-lts/kernel/arch/x86/kvm/kvm.ko.zstAndroid Studio: 2025.3.2
AVD (x86) SDK 36
Properties
AVD (x86) SDK 36,35,34,33
Running with:
cargo ndk build -t x86_64-linux-android -P 26 -p bevy_mobile_example -o ./examples/mobile/android/app/src/main/jniLibs --releasePhysical Pixel 6a (aarch64) SDK 36.1
Running with:
cargo ndk build -t aarch64-linux-android -P 26 -p bevy_mobile_example -o ./examples/mobile/android/app/src/main/jniLibsProblematic Devices (GameActivity and NativeActivity)
AVD (x86) SDK 32,31 (probably until somewhere before 26)
Crashing with:
cargo ndk build -t x86_64-linux-android -P 26 -p bevy_mobile_example -o ./examples/mobile/android/app/src/main/jniLibs --releaseCrashlog (NativeActivity SDK 31)
AVD (x86) SDK 26 (probably all previous SDKs)
Crashing with:
cargo ndk build -t x86_64-linux-android -P 26 -p bevy_mobile_example -o ./examples/mobile/android/app/src/main/jniLibs --releaseCrashlog (NativeActivity SDK 26)
Unrelated regression
Regression from #23551
Crashes if built without
--releaseflag onx86_64. This seems to be only related to the change in android-activity version.I have added a note to README.md for this.
Related