在1.12测试期间,我为Android构建并运行了代码而没有任何问题:
[package]
name = "android"
version = "0.1.0"
authors = ["Author <mail@email.com>"]
build = "build.rs"
[lib]
name = "mylib"
crate-type = ["cdylib"]
我使用了rustup和rustup target add arm-linux-androideabi
。
现在,当我从Java代码加载Rust 1.12库时,我得到:
java.lang.UnsatisfiedLinkError:dlopen失败:找不到符号“rust_begin_unwind”
暂时解决此问题,我need a workaround:
#[allow(unused_variables)]
#[no_mangle]
pub extern
fn rust_begin_unwind(fmt: ::std::fmt::Arguments, file: &'static str, line: u32) -> ! {
loop {}
}