C++ code Module::LoadFromFile() In android failed

I use “Cross Compile” to comile a tvm_runtime.so. Then I use it in android. I find When I run to this code:
tvm::runtime::Module::LoadFromFile("/sdcard/deploy_lib_cpu.so").
It is crached with " dlerror()".
Dose anyone have this problem in android?
Tthank you very much.

This code lib_handle_ = dlopen(name.c_str(), RTLD_LAZY | RTLD_LOCAL); in dso_module.cc is wrong

hi, I encontered the same problem now. can you tell me how do you solver it?

I am trying to use C++ inference API on Android too. I got the same error too. When I write the dlerror() message into a file, it shows that it is lack of libstdc++.so.6 . In fact , it also need other libraries such libc.so.6, lbim.so.6 and so no.
There are many problems in running “Cross Compile” program on Android. Finally, you may get a reloc error. It seems like arm-linux ABI is not compatible with Android ABI.

you can try to open the android app r/w permissions for sdcard,

and then use adb push command to transfer the .so .params and .json to /sdcard

I guess what you mean “Cross Compile” is that you compile the library by arm-linux-gcc toolchain.
That is not true. You should compile all the shared libraries use NDK. Like @howave said here [SOLVED] Is there a way to run TVM C++ inference API on Android

You can just simply add TVM source code into your Android SDK and compile the file “tvm/apps/howto_deploy/tvm_runtime_pack.cc” , then you can get the tvm_runtime.so.
The compile command in CMakeLists.txt like this

add_library(tvm_runtime SHARED  TVM_PATH/tvm/apps/howto_deploy/tvm_runtime_pack.cc)

Android app cannot link libraries in sdcard, i tried this.