rodio
rodio copied to clipboard
Android support
It would be pretty nice if this library supported Android as well. Form what I understand, the main block for that is cpal so I also understand it may be a lot of work to switch it out or update cpal to support Android.
Edit: Actually, it seems from cpal's readme that it does support Android. So maybe the info from https://github.com/RustAudio/rodio/issues/151#issuecomment-357163824 is out of date.
This might be a bug. I'm running NDK 22.1.7171670 . When I try compiling with apk run
(cargo rustc --target aarch64-linux-android
) with let (_stream, stream_handle) = rodio::OutputStream::try_default().unwrap();
in code, I get a big compile error.
error: linking with `/home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang` failed: exit status: 1
|
= note: "/home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang" "-Wl,--allow-multiple-definition" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/sound_galaxy-96f785a9e214d3a6.22wsouu66omv4k1e.rcgu.o" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/sound_galaxy-96f785a9e214d3a6.2fea6i4h7vpwaczp.rcgu.o" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/sound_galaxy-96f785a9e214d3a6.2ggy6ojtdzoo8dq9.rcgu.o" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/sound_galaxy-96f785a9e214d3a6.3998ey3j8qi5t3zt.rcgu.o" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/sound_galaxy-96f785a9e214d3a6.3isi3xj173k07mm2.rcgu.o" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/sound_galaxy-96f785a9e214d3a6.4b8bh1d52xx1kj7t.rcgu.o" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/sound_galaxy-96f785a9e214d3a6.4c83wgn4jejxp52q.rcgu.o" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/sound_galaxy-96f785a9e214d3a6.ylmluevkx25qj9s.rcgu.o" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/sound_galaxy-96f785a9e214d3a6.4oob0qd4qemdcxza.rcgu.o" "-Wl,--as-needed" "-L" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps" "-L" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/debug/deps" "-L" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/build/oboe-sys-f21b9f389294cf55/out/library" "-L" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/build/oboe-sys-f21b9f389294cf55/out/library" "-L" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/build/minimp3-sys-9bbf468ce7e3ea43/out" "-L" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib" "-Wl,-Bstatic" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libsound_galaxy.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/librand-0da55ca91b712e1d.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/librand_chacha-f148fcd60596e2bd.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libppv_lite86-1cda5ff0cbc95666.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/librand_core-b4898c999d2b1e11.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/librodio-1d2f32215d33aec2.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libhound-40f5e4400a0cba14.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liblewton-414ffffa0b3ff048.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libogg-e03181521061243b.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libtinyvec-7b0b34d0733b976c.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libtinyvec_macros-6c62447dbb70de42.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libminimp3-7a16f7705203e87c.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libslice_deque-58aa8b16b8a3f8c4.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libminimp3_sys-d2c7c90d7fe8f579.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libclaxon-53c9169e8492a788.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libcpal-d562d6ddb72ce17c.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liboboe-a9129fdda2d728a7.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libndk_glue-573d9a7cb760f25b.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libndk-2d675b6f42a6ce32.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libjni-09fd450c4c0885a0.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libcesu8-a8652bc5b6017fed.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libcombine-3ddec2525afb2ff5.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libmemchr-b61b8db9bbc66dbe.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libbytes-570c989f39f65cc2.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liboboe_sys-8acfe6f9cc48d249.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libspectrum_analyzer-133a2be9d29b789b.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libfloat_cmp-efd143a87aa76a90.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liblibm-a37559ac1aee1f20.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libmicrofft-92ffce7235eaf4b9.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libstatic_assertions-6b96c21d0ec81cbf.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libnum_complex-d8308c7289a9987e.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libbui-d11af467f8ef8955.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libbytemuck-5133c23df12a059a.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libwgpu-8630d43ace527457.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libwgpu_core-b6f7f19cf0207707.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libcopyless-2546b92b93d77759.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libwgpu_hal-800c0a6c7b6307ac.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/librenderdoc_sys-917ffc346db04dae.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libgpu_descriptor-8ce1ea589993204a.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libgpu_descriptor_types-ea780c9a4d1c3b41.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libkhronos_egl-7b06ca2969737e42.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libprofiling-cc5cc974244df36d.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libgpu_alloc-9edfc26e1ab6dd0f.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libgpu_alloc_types-2bb33b0708999bf0.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libinplace_it-65cb1c2cfd275b43.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libash-8403dbf2aafef4ee.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liblibloading-8c6d7a7b14ab94be.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libnaga-6bc724e659674408.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libfxhash-8320a52efe582171.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libbyteorder-15c564d8898b4555.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libbit_set-d4e8660ad92e41d2.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libbit_vec-377804148bfbbf72.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libcodespan_reporting-e4bb66518de90538.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libunicode_width-b84f6b9f933aa498.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libtermcolor-0c3295830af0bef2.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libhexf_parse-631ec53c0e651aeb.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libspirv-0c0d2546417f5cae.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libnum_traits-249f8c517c196c80.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libindexmap-eb806432d108fd0f.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libhashbrown-b1cee801c0fba95f.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libahash-486f49abb6b926f5.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libgetrandom-f82b63512e6049a0.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libonce_cell-19c8077564a4c8f3.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libwgpu_types-28ba1ee890a32027.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libglow-b32f3db68ee7c605.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libparking_lot-4cb8843a35394de6.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libparking_lot_core-ed56bb440db977ab.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libsmallvec-fbdc045707432758.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liblock_api-dc40a36a48a96fa0.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libscopeguard-074e036b1c06d966.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libarrayvec-76ba91f2549479e4.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libwinit-bf13d03f39f659f7.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libraw_window_handle-5c4ae0a0384d0c3b.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libraw_window_handle-9289827862fb7645.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libcty-d6a7f6578348a3bc.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libndk_glue-f16f0fdc5999a00a.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liblibc-9a0a74ababc1547c.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libndk-9137c210a1e8d834.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libjni_sys-a9626cee6c18ae99.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libndk_sys-b14f7d1922649701.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libthiserror-48eb6fa8b2c2b2da.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libnum_enum-90ef15c6d55294f0.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libinstant-724aebd27ee48a96.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libbitflags-3bc34f45a357c301.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liblog-08d0aca81138224a.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/libcfg_if-53aebe4881554853.rlib" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liblazy_static-e38bd5cf7f6cf4ae.rlib" "-Wl,--start-group" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/libstd-6fb7b48222dfdb50.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/libpanic_unwind-f1ec9676fe65b4d0.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/libminiz_oxide-4d4b4d29ff465768.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/libadler-073f659e23b93f65.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/libobject-19d755ffe5829649.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/libmemchr-84d85dbcc9ba625e.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/libaddr2line-c84fc9244da572a0.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/libgimli-71c965f4b29cbb5b.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/libstd_detect-8b9f7c7068318659.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/librustc_demangle-6968ee3b831b6828.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/libhashbrown-d52d75e622c37aeb.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/librustc_std_workspace_alloc-0820198de102cdf5.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/libunwind-eec74330cadf3534.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/libcfg_if-effbbe02f07b733e.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/liblibc-90fbcfe226becf52.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/liballoc-ad4e861e5140982d.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/librustc_std_workspace_core-e4ea3df9dc1ec838.rlib" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/libcore-7fc2ee196be10e9f.rlib" "-Wl,--end-group" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib/libcompiler_builtins-5234c84775810cca.rlib" "-Wl,-Bdynamic" "-lc++_static" "-llog" "-lOpenSLES" "-ldl" "-landroid" "-ldl" "-llog" "-lgcc" "-lc" "-lm" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/home/clay53/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-linux-android/lib" "-o" "/home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/sound_galaxy-96f785a9e214d3a6" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs"
= note: ld: error: undefined symbol: __cxa_pure_virtual
>>> referenced by AudioStream.cpp
>>> AudioStream.o:(vtable for oboe::AudioStream) in archive /home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liboboe_sys-8acfe6f9cc48d249.rlib
>>> referenced by AudioStream.cpp
>>> AudioStream.o:(vtable for oboe::AudioStream) in archive /home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liboboe_sys-8acfe6f9cc48d249.rlib
>>> referenced by AudioStream.cpp
>>> AudioStream.o:(vtable for oboe::AudioStream) in archive /home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liboboe_sys-8acfe6f9cc48d249.rlib
>>> referenced 38 more times
ld: error: undefined symbol: __cxa_guard_acquire
>>> referenced by QuirksManager.h:43 (oboe/src/common/QuirksManager.h:43)
>>> AudioStreamBuilder.o:(oboe::QuirksManager::getInstance()) in archive /home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liboboe_sys-8acfe6f9cc48d249.rlib
>>> referenced by AAudioExtensions.h:58 (oboe/src/aaudio/AAudioExtensions.h:58)
>>> AudioStreamBuilder.o:(oboe::AAudioExtensions::getInstance()) in archive /home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liboboe_sys-8acfe6f9cc48d249.rlib
>>> referenced by AAudioLoader.cpp:41 (oboe/src/aaudio/AAudioLoader.cpp:41)
>>> AAudioLoader.o:(oboe::AAudioLoader::getInstance()) in archive /home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liboboe_sys-8acfe6f9cc48d249.rlib
>>> referenced 6 more times
ld: error: undefined symbol: __cxa_guard_release
>>> referenced by QuirksManager.h:43 (oboe/src/common/QuirksManager.h:43)
>>> AudioStreamBuilder.o:(oboe::QuirksManager::getInstance()) in archive /home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liboboe_sys-8acfe6f9cc48d249.rlib
>>> referenced by AAudioExtensions.h:58 (oboe/src/aaudio/AAudioExtensions.h:58)
>>> AudioStreamBuilder.o:(oboe::AAudioExtensions::getInstance()) in archive /home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liboboe_sys-8acfe6f9cc48d249.rlib
>>> referenced by AAudioLoader.cpp:41 (oboe/src/aaudio/AAudioLoader.cpp:41)
>>> AAudioLoader.o:(oboe::AAudioLoader::getInstance()) in archive /home/clay53/Dropbox/git/github/clay53/sound_galaxy/target/aarch64-linux-android/debug/deps/liboboe_sys-8acfe6f9cc48d249.rlib
>>> referenced 5 more times
ld: error: undefined symbol: __cxa_begin_catch
>>> referenced by chrono.cpp
>>> chrono.o:(__clang_call_terminate) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
ld: error: undefined symbol: std::terminate()
>>> referenced by chrono.cpp
>>> chrono.o:(__clang_call_terminate) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by thread.cpp:47 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/thread.cpp:47)
>>> thread.o:(std::__ndk1::thread::~thread()) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
ld: error: undefined symbol: __gxx_personality_v0
>>> referenced by chrono.cpp
>>> chrono.o:(DW.ref.__gxx_personality_v0) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
ld: error: undefined symbol: std::get_new_handler()
>>> referenced by new.cpp:71 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/new.cpp:71)
>>> new.o:(operator new(unsigned long)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by new.cpp:190 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/new.cpp:190)
>>> new.o:(operator new(unsigned long, std::align_val_t)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
ld: error: undefined symbol: __cxa_allocate_exception
>>> referenced by new.cpp:76 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/new.cpp:76)
>>> new.o:(operator new(unsigned long)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by new.cpp:195 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/new.cpp:195)
>>> new.o:(operator new(unsigned long, std::align_val_t)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by stdexcept:269 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/include/stdexcept:269)
>>> string.o:(std::__ndk1::__throw_out_of_range(char const*)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced 1 more times
ld: error: undefined symbol: std::bad_alloc::bad_alloc()
>>> referenced by new.cpp:76 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/new.cpp:76)
>>> new.o:(operator new(unsigned long)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by new.cpp:195 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/new.cpp:195)
>>> new.o:(operator new(unsigned long, std::align_val_t)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
ld: error: undefined symbol: typeinfo for std::bad_alloc
>>> referenced by new.cpp:76 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/new.cpp:76)
>>> new.o:(operator new(unsigned long)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by new.cpp:76 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/new.cpp:76)
>>> new.o:(operator new(unsigned long)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by new.cpp:195 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/new.cpp:195)
>>> new.o:(operator new(unsigned long, std::align_val_t)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced 1 more times
ld: error: undefined symbol: std::bad_alloc::~bad_alloc()
>>> referenced by new.cpp:76 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/new.cpp:76)
>>> new.o:(operator new(unsigned long)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by new.cpp:76 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/new.cpp:76)
>>> new.o:(operator new(unsigned long)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by new.cpp:195 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/new.cpp:195)
>>> new.o:(operator new(unsigned long, std::align_val_t)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced 1 more times
ld: error: undefined symbol: __cxa_throw
>>> referenced by new.cpp:76 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/new.cpp:76)
>>> new.o:(operator new(unsigned long)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by new.cpp:195 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/new.cpp:195)
>>> new.o:(operator new(unsigned long, std::align_val_t)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by stdexcept:269 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/include/stdexcept:269)
>>> string.o:(std::__ndk1::__throw_out_of_range(char const*)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced 1 more times
ld: error: undefined symbol: vtable for std::logic_error
>>> referenced by stdexcept_default.ipp:24 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/support/runtime/stdexcept_default.ipp:24)
>>> stdexcept.o:(std::logic_error::logic_error(char const*)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by stdexcept_default.ipp:24 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/support/runtime/stdexcept_default.ipp:24)
>>> stdexcept.o:(std::logic_error::logic_error(char const*)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
ld: error: undefined symbol: std::exception::~exception()
>>> referenced by stdexcept_default.ipp:24 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/support/runtime/stdexcept_default.ipp:24)
>>> stdexcept.o:(std::logic_error::logic_error(char const*)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by stdexcept_default.ipp:33 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/support/runtime/stdexcept_default.ipp:33)
>>> stdexcept.o:(std::runtime_error::runtime_error(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
ld: error: undefined symbol: vtable for std::runtime_error
>>> referenced by stdexcept_default.ipp:33 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/support/runtime/stdexcept_default.ipp:33)
>>> stdexcept.o:(std::runtime_error::runtime_error(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by stdexcept_default.ipp:33 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/support/runtime/stdexcept_default.ipp:33)
>>> stdexcept.o:(std::runtime_error::runtime_error(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
ld: error: undefined symbol: typeinfo for std::out_of_range
>>> referenced by stdexcept:269 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/include/stdexcept:269)
>>> string.o:(std::__ndk1::__throw_out_of_range(char const*)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by stdexcept:269 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/include/stdexcept:269)
>>> string.o:(std::__ndk1::__throw_out_of_range(char const*)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
ld: error: undefined symbol: std::out_of_range::~out_of_range()
>>> referenced by stdexcept:269 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/include/stdexcept:269)
>>> string.o:(std::__ndk1::__throw_out_of_range(char const*)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by stdexcept:269 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/include/stdexcept:269)
>>> string.o:(std::__ndk1::__throw_out_of_range(char const*)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
ld: error: undefined symbol: __cxa_free_exception
>>> referenced by stdexcept:269 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/include/stdexcept:269)
>>> string.o:(std::__ndk1::__throw_out_of_range(char const*)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by system_error.cpp:287 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/system_error.cpp:287)
>>> system_error.o:(std::__ndk1::__throw_system_error(int, char const*)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
ld: error: undefined symbol: vtable for std::out_of_range
>>> referenced by stdexcept:167 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/include/stdexcept:167)
>>> string.o:(std::out_of_range::out_of_range(char const*)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by stdexcept:167 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/include/stdexcept:167)
>>> string.o:(std::out_of_range::out_of_range(char const*)) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
ld: error: undefined symbol: std::runtime_error::~runtime_error()
>>> referenced by system_error.cpp:281 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/system_error.cpp:281)
>>> system_error.o:(std::__ndk1::system_error::~system_error()) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
>>> referenced by system_error.cpp:281 (/buildbot/src/android/ndk-release-r22/toolchain/llvm-project/libcxx/src/system_error.cpp:281)
>>> system_error.o:(std::__ndk1::system_error::~system_error()) in archive /home/clay53/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/libc++_static.a
ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: could not compile `sound_galaxy` due to previous error
Error: Command `cargo rustc --target aarch64-linux-android` had a non-zero exit code.
I've got the same issue, except mine compiles fine and I get the error at runtime - same thing, though - __cxa_pure_virtual
I had the same problem. These two easy fixes made audio working on android for me: 1: Add this to your code
#[no_mangle]
pub extern "C" fn __cxa_pure_virtual() {
loop {}
}
2: Create a build.rs file for your crate with the following code:
use std::env;
fn main() {
// https://kazlauskas.me/entries/writing-proper-buildrs-scripts
let target_os = env::var("CARGO_CFG_TARGET_OS");
match target_os.as_ref().map(|x| &**x) {
Ok("android") => {
println!("cargo:rustc-link-lib=dylib=stdc++");
println!("cargo:rustc-link-lib=c++_shared");
},
_ => {}
}
}
(@AndriBaal) Where in your code did you insert this? I'm trying to understand in what context it's used.
#[no_mangle] pub extern "C" fn __cxa_pure_virtual() { loop {} }
The link included here was very interesting, thanks for sharing it!
fn main() { // https://kazlauskas.me/entries/writing-proper-buildrs-scripts let target_os = env::var("CARGO_CFG_TARGET_OS");
I found it to be effective when placed just before importing the rodio crate! But in my case it just triggered similar follow up errors. Better would be to fix android compatibility in the rodio crate. Now when cpal is android compatible.
(@AndriBaal) Where in your code did you insert this? I'm trying to understand in what context it's used.
#[no_mangle] pub extern "C" fn __cxa_pure_virtual() { loop {} }
Did you have any luck running rodio on android yet? Another thing that I did with the dependency of rodio in my Cargo.toml, is that I disabled the default features and enabled symphonia-all
. I don't remember if I did it because of WASM or android. Rodio looks like this in my Cargo.toml:
rodio = { version = "0.17", default-features = false, optional = true, features = [
"symphonia-all",
] }
If you want to test it for yourself, you can head to this repository, clone it, nevigate to the template
directory and run it using cargo apk run --lib
. There are also some instructions in the README.md of the template as well as a script for setting up ndk, sdk and all the libraries you need. If you run the app, you should hear a beep at the start.
Let me know if you still have problems running it or if I should have a look over it ;)
Thanks very much!
I solved my initial runtime error by having your solution from October 2022 lead my way. But rather than just writing dummy functions, I went full circle and included the whole missing libc++_shared
library in the build and it worked. This follow up is great to, I'll give it a try to set sumphonia-all
and see if that can work on its own. Would be much cleaner! :)
btw: https://github.com/cunarist/rinf/issues/280#issuecomment-1917060054
The question of default android support in rodio, is being kept in the rinf
project that aims to integrate rust in flutter development. If anyone in this rodio
package knows more about the details and if it could be done, I think it's a good time to move forward on this.