Hello Alex, Thank You for response!
Yes, I started my investigation with this example, but it doesn’t work out of the box. I’m getting app successfully compiled, but after it sends me to Live Reload screen on my Android device it shows Felgo based QML window with error log:
An error occured, please check the log output for details!
qrc:/qml/Main.qml:16:1: module "QtCharts" is not installed
qrc:/qml/Main.qml:12:1: module "QtQuick.XmlListModel" is not installed
...
It looks like FelgoLive_arm64-v8a.so can’t find dependencies of it’s root QML file – we can see all the dependencies here Qt/5.15.2/android/mkspecs/common/felgo/FelgoLive/Imports.qml
I spent a few days researching the problem and tried many different things with no success.
I have these strings in CMakeLists.txt to make Felgo and Felgo Live work:
set(PRODUCT_IDENTIFIER CACHE STRING "com.myapp.test")
set(PRODUCT_VERSION_NAME CACHE STRING "1.0.0")
set(PRODUCT_VERSION_CODE CACHE STRING "1")
set(PRODUCT_LICENSE_KEY CACHE STRING "felgo-license-key-here")
find_package(Felgo REQUIRED)
find_package(FelgoLive REQUIRED)
include_directories(${Felgo_INCLUDE_DIRS})
include_directories(${FelgoLive_INCLUDE_DIRS})
Also to make find_package function work I was needed to make some changes in Qt internal cmake scripts(I know it’s a bad practice, but I want to achieve a simple MVP with Hot Reloading on Android device first).
Standart Felgo qmake template (https://github.com/FelgoSDK/QtQuickFelgoLiveExample-qmake) with Felgo Live enabled works for me out of the box so my final thoughts were to compare Android build system artifact outputs for Cmake and Qmake examples.
I found out that final “android-build/libs” directory for Qmake template consists of 138 different libraries, but Cmake version consist of only 118 libraries and it looks like this difference is exact the missing libs or plugins!
libcrypto_1_1.so
libssl_1_1.so
libqml_qt3d_core_quick3dcoreplugin_arm64-v8a.so
libqml_qt3d_extras_quick3dextrasplugin_arm64-v8a.so
libqml_qt3d_input_quick3dinputplugin_arm64-v8a.so
libqml_qt3d_logic_quick3dlogicplugin_arm64-v8a.so
libqml_qt3d_render_quick3drenderplugin_arm64-v8a.so
libqml_qt_labs_folderlistmodel_qmlfolderlistmodelplugin_arm64-v8a.so
libqml_qtbluetooth_declarative_bluetooth_arm64-v8a.so
libqml_qtcharts_qtchartsqml2_arm64-v8a.so <<<<<<<<------- qrc:/qml/Main.qml:16:1: module "QtCharts" is not installed
libqml_qtdatavisualization_datavisualizationqml2_arm64-v8a.so
libqml_qtnfc_declarative_nfc_arm64-v8a.so
libqml_qtquick_dialogs_dialogplugin_arm64-v8a.so
libqml_qtquick_dialogs_private_dialogsprivateplugin_arm64-v8a.so
libqml_qtquick_privatewidgets_widgetsplugin_arm64-v8a.so
libqml_qtquick_scene3d_qtquickscene3dplugin_arm64-v8a.so
libqml_qtquick_xmllistmodel_qmlxmllistmodelplugin_arm64-v8a.so <<<<<<<<------- qrc:/qml/Main.qml:12:1: module "QtQuick.XmlListModel" is not installed
libqml_qtsensors_declarative_sensors_arm64-v8a.so <<<<<<<<------- qrc:/qml/Main.qml:12:1: module "QtSensors" is not installed
libqml_qtwebsockets_declarative_qmlwebsockets_arm64-v8a.so
libqt53danimation_arm64-v8a.so
libqt53dquickextras_arm64-v8a.so
libqt53dquickinput_arm64-v8a.so
libqt53dquickrender_arm64-v8a.so
libqt5datavisualization_arm64-v8a.so
libqt5xmlpatterns_arm64-v8a.so
I decided to try to add these libraries manually. I created Android template with custom AndroidManifest.xml file, “libs” and “resources” folder.
The first thing I found after building the project – if I run QtQuickFelgoLiveExample-cmake original example without “android” folder (by cloning and running) the resulting application and main activity names are:
android:name="org.qtproject.qt5.android.bindings.QtApplication"
android:name="org.qtproject.qt5.android.bindings.QtActivity"
but as I understand they should be Felgo wrappers for these classes:
android:name="net.vplay.helper.VPlayApplication"
android:name="net.vplay.helper.VPlayActivity"
By comparing these examples I made the outputs completely similar if open them in Android Studio after building in Qt Creator.
So the errors with missing libraries are gone. And then it shows the error which I described in the head message of this topic, but it looks like it’s FelgoLive internals and I’m not allowed to change it and fix this error.
Also I have another idea – running these lines of Qmake example *.pro files moves all “qml” folder(with *.qml files and config.json file) to Android Studio project assets folder. I don’t understand exactly why we need this, but I guess it may be related to qml dependencies resolving mechanism. Maybe I need to make some similar step for Cmake project?
qmlFolder.source = qml
DEPLOYMENTFOLDERS += qmlFolder # comment for publishing
Also maybe this one is related?: https://felgo.com/developers/forums/t/qtcharts-doesnt-work-in-felgo-live
Thank you!