awtterpip / bevy_oxr

Apache License 2.0
249 stars 39 forks source link

APK error on example x builds #124

Open jreuben11 opened 5 months ago

jreuben11 commented 5 months ago

when compiling examples for quest, I get the following error:

[3/3] Create apk Error: Failed to collect all required libraries for /bevy_oxr/examples/android/runtime_libs/arm64-v8a/libopenxr_loader.so Shared librarylibm.so.6` not found

UPDATE 1: After installing Android SDK and NDK:

in ~/Code/git_clones/bevy_oxr/examples/android running x build --release

I get:

[2/3] Build rust `bevy_openxr_android` [98ms]
[3/3] Create appimage
Error: failed to locate bin ~/Code/git_clones/bevy_oxr/target/x/release/linux/x64/cargo/release/bevy_openxr_android

target/x/release/linux/x64/cargo/release exists but does not contain bevy_openxr_android or bevy_openxr

when I try RUST_BACKTRACE=1 cargo apk build --release I get:

Using package `bevy_openxr_android` in `~/Code/git_clones/bevy_oxr/examples/android/Cargo.toml`
thread 'main' panicked at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ndk-build-0.10.0/src/ndk.rs:89:14:
Failed to read source.properties: Os { code: 2, kind: NotFound, message: "No such file or directory" }
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: ndk_build::ndk::Ndk::from_env
   4: cargo_apk::apk::ApkBuilder::from_subcommand
   5: cargo_apk::main
ChristianSchott commented 1 month ago

I know this issue is old, but maybe this helps someone..

For building an apk with xbuild, you have to specify the target platform: x build --release -p bevy_openxr_android --platform android --arch arm64 --format apk

Regarding the error with cargo-apk, it seems like your ANDROID_NDK_ROOT environment variable is not set, or set incorrectly.