Android loading plugin "dlopen failed: "
-
wrote on 19 Jan 2024, 14:38 last edited by
I am trying to add MapLibre to the Qt 6.6.1 Android project. Android can not dlopen plugin during the app launch.
W ru.ubego.debug: Accessing hidden method Landroid/graphics/drawable/StateListDrawable;->getStateCount()I (light greylist, linking) E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread E AndroidRuntime: Process: ru.ubego.debug, PID: 3895 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "/home/dev/dev/prj/ubego-mobile-app/build-ubego-Android_Qt_6_6_1_Clang_arm64_v8a-Debug/libs/arm64-v8a/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_arm64-v8a.so" not found E AndroidRuntime: at java.lang.Runtime.load0(Runtime.java:928) E AndroidRuntime: at java.lang.System.load(System.java:1633) E AndroidRuntime: at org.qtproject.qt.android.QtNative$4.run(QtNative.java:311) E AndroidRuntime: at org.qtproject.qt.android.QtThread$2.run(QtThread.java:51) E AndroidRuntime: at org.qtproject.qt.android.QtThread$1.run(QtThread.java:25) E AndroidRuntime: at java.lang.Thread.run(Thread.java:764)
what I add to qmake
INCLUDEPATH *= \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_libsrc/core/include/ \ LIBS *= $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib//install/lib/libQMapLibre_$${ARCH}.so \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so \ ANDROID_EXTRA_LIBS += $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibre_$${ARCH}.so \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \ ANDROID_EXTRA_PLUGINS += $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins \
So, I add libs to
LIBS
andANDROID_EXTRA_LIBS
. I add directory with the plugin itself toANDROID_EXTRA_PLUGINS
.
Does anybody have ideas? -
I am trying to add MapLibre to the Qt 6.6.1 Android project. Android can not dlopen plugin during the app launch.
W ru.ubego.debug: Accessing hidden method Landroid/graphics/drawable/StateListDrawable;->getStateCount()I (light greylist, linking) E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread E AndroidRuntime: Process: ru.ubego.debug, PID: 3895 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "/home/dev/dev/prj/ubego-mobile-app/build-ubego-Android_Qt_6_6_1_Clang_arm64_v8a-Debug/libs/arm64-v8a/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_arm64-v8a.so" not found E AndroidRuntime: at java.lang.Runtime.load0(Runtime.java:928) E AndroidRuntime: at java.lang.System.load(System.java:1633) E AndroidRuntime: at org.qtproject.qt.android.QtNative$4.run(QtNative.java:311) E AndroidRuntime: at org.qtproject.qt.android.QtThread$2.run(QtThread.java:51) E AndroidRuntime: at org.qtproject.qt.android.QtThread$1.run(QtThread.java:25) E AndroidRuntime: at java.lang.Thread.run(Thread.java:764)
what I add to qmake
INCLUDEPATH *= \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_libsrc/core/include/ \ LIBS *= $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib//install/lib/libQMapLibre_$${ARCH}.so \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so \ ANDROID_EXTRA_LIBS += $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibre_$${ARCH}.so \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \ ANDROID_EXTRA_PLUGINS += $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins \
So, I add libs to
LIBS
andANDROID_EXTRA_LIBS
. I add directory with the plugin itself toANDROID_EXTRA_PLUGINS
.
Does anybody have ideas?wrote on 19 Jan 2024, 14:50 last edited by JoeCFD@Kofr add $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so
to ANDROID_EXTRA_LIBS as well. This is not a Qt plugin, but an extra one.ANDROID_EXTRA_LIBS += $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibre_$${ARCH}.so \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so \
All Qt libs and plugins needed for Android will be wrapped automatically. All your own and third party libs and plugins have to be added to ANDROID_EXTRA_LIBS for deployment.
-
wrote on 19 Jan 2024, 14:46 last edited by
The only thisng bothers me is why dlopen tryies to open the plugin with the linux host path.
dlopen failed: library "/home/dev/dev/prj/ubego-mobile-app/build-ubego-Android_Qt_6_6_1_Clang_arm64_v8a-Debug/libs/arm64-v8a/maplibre_native_qt_lib/install/plugins/geoservices
when the starts on the Android device -
I am trying to add MapLibre to the Qt 6.6.1 Android project. Android can not dlopen plugin during the app launch.
W ru.ubego.debug: Accessing hidden method Landroid/graphics/drawable/StateListDrawable;->getStateCount()I (light greylist, linking) E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread E AndroidRuntime: Process: ru.ubego.debug, PID: 3895 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "/home/dev/dev/prj/ubego-mobile-app/build-ubego-Android_Qt_6_6_1_Clang_arm64_v8a-Debug/libs/arm64-v8a/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_arm64-v8a.so" not found E AndroidRuntime: at java.lang.Runtime.load0(Runtime.java:928) E AndroidRuntime: at java.lang.System.load(System.java:1633) E AndroidRuntime: at org.qtproject.qt.android.QtNative$4.run(QtNative.java:311) E AndroidRuntime: at org.qtproject.qt.android.QtThread$2.run(QtThread.java:51) E AndroidRuntime: at org.qtproject.qt.android.QtThread$1.run(QtThread.java:25) E AndroidRuntime: at java.lang.Thread.run(Thread.java:764)
what I add to qmake
INCLUDEPATH *= \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_libsrc/core/include/ \ LIBS *= $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib//install/lib/libQMapLibre_$${ARCH}.so \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so \ ANDROID_EXTRA_LIBS += $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibre_$${ARCH}.so \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \ ANDROID_EXTRA_PLUGINS += $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins \
So, I add libs to
LIBS
andANDROID_EXTRA_LIBS
. I add directory with the plugin itself toANDROID_EXTRA_PLUGINS
.
Does anybody have ideas?wrote on 19 Jan 2024, 14:50 last edited by JoeCFD@Kofr add $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so
to ANDROID_EXTRA_LIBS as well. This is not a Qt plugin, but an extra one.ANDROID_EXTRA_LIBS += $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibre_$${ARCH}.so \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so \
All Qt libs and plugins needed for Android will be wrapped automatically. All your own and third party libs and plugins have to be added to ANDROID_EXTRA_LIBS for deployment.
-
@Kofr add $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so
to ANDROID_EXTRA_LIBS as well. This is not a Qt plugin, but an extra one.ANDROID_EXTRA_LIBS += $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibre_$${ARCH}.so \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/lib/libQMapLibreLocation_$${ARCH}.so \ $$top_build_dir/libs/$${ARCH}/maplibre_native_qt_lib/install/plugins/geoservices/libplugins_geoservices_qtgeoservices_maplibre_$${ARCH}.so \
All Qt libs and plugins needed for Android will be wrapped automatically. All your own and third party libs and plugins have to be added to ANDROID_EXTRA_LIBS for deployment.
wrote on 19 Jan 2024, 15:08 last edited by@JoeCFD Thank you for reply. It works.
However during the startup QML can not resolve
: qrc:/XPage.qml:4 module "QtLocation.MapLibre" is not installed
on desktop it worked when I add a path to the plugin to
library path
,QCoreApplication::addLibraryPath("/home/prj/maplibre-native-qt/install/plugins/");
but how it works on Android?
Documentation is poor about this. -
@JoeCFD Thank you for reply. It works.
However during the startup QML can not resolve
: qrc:/XPage.qml:4 module "QtLocation.MapLibre" is not installed
on desktop it worked when I add a path to the plugin to
library path
,QCoreApplication::addLibraryPath("/home/prj/maplibre-native-qt/install/plugins/");
but how it works on Android?
Documentation is poor about this. -
1/5