diff --git a/docs-template/EXAMPLE_README.md.tpl b/docs-template/EXAMPLE_README.md.tpl index f92ad89385726..2f3e994d43092 100644 --- a/docs-template/EXAMPLE_README.md.tpl +++ b/docs-template/EXAMPLE_README.md.tpl @@ -45,7 +45,6 @@ git checkout v0.4.0 - [Android](#android) - [Setup](#setup) - [Build & Run](#build--run) - - [About `libc++_shared.so`](#about-libc_sharedso) - [Old phones](#old-phones) - [About `cargo-apk`](#about-cargo-apk) - [iOS](#ios) @@ -130,14 +129,6 @@ Or build it with Android Studio. Then you can test it in your Android project. -##### About `libc++_shared.so` - -Bevy may require `libc++_shared.so` to run on Android, as it is needed by the `oboe` crate, but typically `cargo-ndk` does not copy this file automatically. - -To include it, you can manually obtain it from NDK source or use a `build.rs` script for automation, as described in the `cargo-ndk` [README](https://github.com/bbqsrc/cargo-ndk?tab=readme-ov-file#linking-against-and-copying-libc_sharedso-into-the-relevant-places-in-the-output-directory). - -Alternatively, you can modify project files to include it when building an APK. To understand the specific steps taken in this project, please refer to the comments within the project files for detailed instructions(`app/CMakeList.txt`, `app/build.gradle`, `app/src/main/cpp/dummy.cpp`). - #### Debugging You can view the logs with the following command: diff --git a/examples/README.md b/examples/README.md index f1b5b7eaa8c93..3899b91777269 100644 --- a/examples/README.md +++ b/examples/README.md @@ -77,7 +77,6 @@ git checkout v0.4.0 - [Android](#android) - [Setup](#setup) - [Build & Run](#build--run) - - [About `libc++_shared.so`](#about-libc_sharedso) - [Old phones](#old-phones) - [About `cargo-apk`](#about-cargo-apk) - [iOS](#ios) @@ -730,14 +729,6 @@ Or build it with Android Studio. Then you can test it in your Android project. -##### About `libc++_shared.so` - -Bevy may require `libc++_shared.so` to run on Android, as it is needed by the `oboe` crate, but typically `cargo-ndk` does not copy this file automatically. - -To include it, you can manually obtain it from NDK source or use a `build.rs` script for automation, as described in the `cargo-ndk` [README](https://github.com/bbqsrc/cargo-ndk?tab=readme-ov-file#linking-against-and-copying-libc_sharedso-into-the-relevant-places-in-the-output-directory). - -Alternatively, you can modify project files to include it when building an APK. To understand the specific steps taken in this project, please refer to the comments within the project files for detailed instructions(`app/CMakeList.txt`, `app/build.gradle`, `app/src/main/cpp/dummy.cpp`). - #### Debugging You can view the logs with the following command: diff --git a/examples/mobile/android_example/app/CMakeLists.txt b/examples/mobile/android_example/app/CMakeLists.txt deleted file mode 100644 index c388547c20a0e..0000000000000 --- a/examples/mobile/android_example/app/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -# This is part of a hack to convince gradle to insert libc++_shared.so -cmake_minimum_required(VERSION 3.4.1) -project(cppshared_dummy) -set (SRC_DIR ./src/main/cpp) -add_library (dummy SHARED ${SRC_DIR}/dummy.cpp) diff --git a/examples/mobile/android_example/app/build.gradle b/examples/mobile/android_example/app/build.gradle index c21a9de6295fc..94be007f51f1c 100644 --- a/examples/mobile/android_example/app/build.gradle +++ b/examples/mobile/android_example/app/build.gradle @@ -12,23 +12,12 @@ android { targetSdk 33 versionCode 1 versionName "1.0" - // need this otherwise it won't insert libc++_shared.so - externalNativeBuild { - cmake { - arguments "-DANDROID_STL=c++_shared" - } - } // set up targets ndk { abiFilters 'arm64-v8a' } testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - externalNativeBuild { - cmake { - path "CMakeLists.txt" - } - } buildTypes { release { minifyEnabled false @@ -42,10 +31,6 @@ android { buildFeatures { prefab true } - // The final part to insert libc++_shared.so only - packagingOptions { - exclude 'lib/*/libdummy.so' - } sourceSets { main { assets.srcDirs += files('../../../../assets') diff --git a/examples/mobile/android_example/app/src/main/cpp/dummy.cpp b/examples/mobile/android_example/app/src/main/cpp/dummy.cpp deleted file mode 100644 index c20beb86c6f7a..0000000000000 --- a/examples/mobile/android_example/app/src/main/cpp/dummy.cpp +++ /dev/null @@ -1,2 +0,0 @@ -// Intentionally blank -- this is a dummy code! -// This is part of a hack to convince gradle to insert libc++_shared.so \ No newline at end of file diff --git a/examples/mobile/android_example_native/app/CMakeLists.txt b/examples/mobile/android_example_native/app/CMakeLists.txt deleted file mode 100644 index c388547c20a0e..0000000000000 --- a/examples/mobile/android_example_native/app/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -# This is part of a hack to convince gradle to insert libc++_shared.so -cmake_minimum_required(VERSION 3.4.1) -project(cppshared_dummy) -set (SRC_DIR ./src/main/cpp) -add_library (dummy SHARED ${SRC_DIR}/dummy.cpp) diff --git a/examples/mobile/android_example_native/app/build.gradle b/examples/mobile/android_example_native/app/build.gradle index 4b33cd78017f4..68237739283b6 100644 --- a/examples/mobile/android_example_native/app/build.gradle +++ b/examples/mobile/android_example_native/app/build.gradle @@ -12,23 +12,12 @@ android { targetSdk 33 versionCode 1 versionName "1.0" - // need this otherwise it won't insert libc++_shared.so - externalNativeBuild { - cmake { - arguments "-DANDROID_STL=c++_shared" - } - } // set up targets ndk { abiFilters 'arm64-v8a' } testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - externalNativeBuild { - cmake { - path "CMakeLists.txt" - } - } buildTypes { release { minifyEnabled false @@ -42,11 +31,6 @@ android { buildFeatures { viewBinding true } - // The final part to insert libc++_shared.so only - packagingOptions { - exclude 'lib/*/libdummy.so' - } - sourceSets { main { assets.srcDirs += files('../../../../assets') diff --git a/examples/mobile/android_example_native/app/src/main/cpp/dummy.cpp b/examples/mobile/android_example_native/app/src/main/cpp/dummy.cpp deleted file mode 100644 index c20beb86c6f7a..0000000000000 --- a/examples/mobile/android_example_native/app/src/main/cpp/dummy.cpp +++ /dev/null @@ -1,2 +0,0 @@ -// Intentionally blank -- this is a dummy code! -// This is part of a hack to convince gradle to insert libc++_shared.so \ No newline at end of file