Qt World Summit: Submit your Presentation

[iOS] defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.camera"

  • Does anyone know what to do about this? My app runs perfectly fine on Android and, except for the camera, on iOS.

    I get this error when attempting to load the QML camera component:
    defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.camera"

    I have set NSCameraUsageDescription (seemingly, the only camera related field) in the Info.plist file.
    I'm quite comfortable around Qt desktop and Android, but this is the first day I've touched iOS with Qt apps. Any ideas are appreciated.

  • I found the answer: http://doc.qt.io/qt-5/porting-to-ios.html

    I added these values in my .pro file:

    QT += multimedia
    QTPLUGIN += qavfcamera

    as the docs note...
    In Qt for iOS, everything is compiled statically and placed into the application bundle. The applications are "sandboxed" inside their bundles and cannot make use of shared object files. Because of this, also the plugins used by the Qt modules need to be statically linked. To do this, define the required plugins using the QTPLUGIN variable. For example, to use the camera APIs from Qt Multimedia:

  • Qt Champions 2016

    @refaQtor using Qt 5.5 or greater you'll get an error:
    Project WARNING: Redundant entries in QTPLUGIN: qavfcamera

    QTPLUGIN: qavfcamera is automatically added
    see https://wiki.qt.io/QtMultimedia_on_iOS_and_tvOS

Log in to reply