COVESA / vsomeip

An implementation of Scalable service-Oriented MiddlewarE over IP
Mozilla Public License 2.0
1.01k stars 647 forks source link

[ISSUE] How to fix : "1 Configuration module could not be loaded!" in Android env? #658

Open canaanfredi opened 1 month ago

canaanfredi commented 1 month ago

vSomeip Version

v3.3.8

Boost Version

1.84.0

Environment

Android NDK r25c

Describe the bug

As I cross compile vsomeip by Android NDK(version: r25c) in my Mac and I adb push all the folder to Android AVD. And I chmod +x for this. Since I adb shell and want run the hello world it shows

Screenshot 2024-03-27 at 15 55 55

How to fix it?

Reproduction Steps

No response

Expected behaviour

No response

Logs and Screenshots

No response

canaanfredi commented 1 month ago

I use this cmd below:

cmake -B ./build -G Ninja -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86_64 -S .
cmake --build ./build
canaanfredi commented 1 month ago

build details: https://github.com/canaanfredi/vsomeip-anroid-cmake I just change vsomeip version from 3.4.10 to 3.3.8

canaanfredi commented 1 month ago

https://github.com/COVESA/vsomeip/blob/master/implementation/configuration/include/internal_android.hpp

Screenshot 2024-03-28 at 09 48 57

Notice that this header file we tried to rename libvsomeip3-cfg.so TO libvsomeip_cfg.so but we got this: WeChatWorkScreenshot_2d2c4a45-6fca-485e-9c76-307a2b8685b7

007herelsp commented 1 month ago

dynamic_pointer_cast this issue where some objects return nullptr Created outside of the boundaries of the shared library. See below discuss for more details. https://github.com/android/ndk/issues/519 https://github.com/android/ndk/issues/533

haohaolee commented 1 month ago

Hi @007herelsp

Thanks very much for the info. I have carefully studied the discussions for all these, my current understanding is: The only approach for Android is linking the cfg library explicitly. Do I understand correctly?

I have tried some things like

None of the above worked.

ps: I personally do not like using dynamic_cast cross module boundaries, which leads to a dark place in the ABI spec. Maybe we should redesign the plugin system to rely on more stable interfaces.

Best regards,

007herelsp commented 1 month ago

Hi @007herelsp

Thanks very much for the info. I have carefully studied the discussions for all these, my current understanding is: The only approach for Android is linking the cfg library explicitly. Do I understand correctly?

I have tried some things like

  • dlopen with DL_GLOBAL
  • add a key function to configuration_plugin

None of the above worked.

ps: I personally do not like using dynamic_cast cross module boundaries, which leads to a dark place in the ABI spec. Maybe we should redesign the plugin system to rely on more stable interfaces.

Best regards,

I'll submit code to fix this