Error using the openssl crate on Android (Flutter FFI)

Hi,

I'm trying to compile a crate as a cdylib which depends on openssl on Android.

I've no problem compiling using PKG_CONFIG_ALLOW_CROSS=1 OPENSSL_STATIC=1 cargo build --target i686-linux-android

but when loading the library (from Flutter FFI) I got the following error:

Failed to load dynamic library (dlopen failed: cannot locate symbol "BIO_new" referenced by "/data/app/com.bloom42.bloom-DGdvbdkpe0vm2h86DsYL6Q==/lib/x86/libcore_ffi.so"...)

Using i686-linux-android-objdump -p target/i686-linux-android/debug/libcore_ffi.so | rg NEEDED I got:

  NEEDED               libdl.so
  NEEDED               libc.so
  NEEDED               libm.so

So openssl seems successfully statically linked.

but running i686-linux-android -nm -u target/i686-linux-android/debug/libcore_ffi.so | rg BIO returns:

       U BIO_clear_flags
         U BIO_ctrl
         U BIO_free_all
         U BIO_new
         U BIO_new_mem_buf
         U BIO_s_mem
         U BIO_set_flags

So it appears that the symbols (from openssl) are unknown...

Any idea?

https://github.com/sfackler/rust-openssl/issues/1165

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.