vsomeip icon indicating copy to clipboard operation
vsomeip copied to clipboard

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

Open canaanfredi opened this issue 11 months ago • 6 comments

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 avatar Mar 27 '24 07:03 canaanfredi

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 avatar Mar 27 '24 08:03 canaanfredi

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

canaanfredi avatar Mar 27 '24 09:03 canaanfredi

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

canaanfredi avatar Mar 28 '24 01:03 canaanfredi

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

007herelsp avatar Mar 28 '24 06:03 007herelsp

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,

haohaolee avatar Mar 28 '24 10:03 haohaolee

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

007herelsp avatar Mar 28 '24 13:03 007herelsp

@007herelsp I am very concerned about whether there is a stable version available for Android.

KooWu avatar Nov 01 '24 03:11 KooWu