Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

OSM plugin is not working on deployed target



  • Hi,

    I'm using OSM plugin in a QmlWidget and it is running just fine on my machine. But if I deploy it to another machine (like my test virtual box machine) it is not showing anything at all, even the copyright information.

    Both machines are Ubuntu but dev machine is 18.10 and target is 18.04. The deployed image does not give log any dependency error messages but I'm receiving an error message from map widget which is taken via onErrorChanged QML signal:

    qml: Map error: 1
    

    Any idea how to fix this?

    Here's the code of the QmlWidget:

    import QtQuick 2.0
    import QtQuick.Window 2.0
    import QtLocation 5.12
    import QtPositioning 5.12
    
    Rectangle
    {
        width: 1000
        height: 550
        visible: true
    
        Plugin
        {
            id: mapPlugin
            name: "osm"
        }
    
        Map
        {
            id: map
            anchors.fill: parent
            plugin: mapPlugin
            zoomLevel: 12
    
            onErrorChanged: {
            console.log("Map error: " + map.error)
            }
        }
    
        function centerPos(lat, lon)
        {
            map.center = QtPositioning.coordinate(lat, lon);
        }
    
        function setZoomLevel(level)
        {
            map.zoomLevel = level;
        }
    }
    

    Qt 5.12.0



  • For those, who may face this kind of issue in the future:

    I've solved the case, but partially. Even though nothing whines about a missing library, something should be definitely missing. I've copied all of the lib folder (which resides in 'Qt/5.X.Y/gcc_64/lib' directory) into the deployed target and everything started to work as expected.

    This tells me that QML engine could have issues with missing libraries, but sometimes it doesn't tell us what's going on.

    Cheers,


  • Moderators

    @MuratUrsavas
    the common way for such issues is:

    1. set QT_DEBUG_PLUGINS=1 env variable
    2. check if the desired plugin is loaded (by inspecting the console output during application start)
    3. if the plugin is not loaded check if it's dependencies can be found and loaded (e.g. with ldd on Linux, DependencyWalker on Windows)
    4. if the plugin is loaded there should be either a console output, error property or a possible logging rule for the corresponding module

Log in to reply