QT for IOS 相机错误(requestService(): no service found for - "org.qt-project.qt.camera")

环境:qt5.12,xcode10,ios12

qt实例如下:

import QtMultimedia 5.8

Item {
    width: 640
    height: 360

    Camera {
        id: camera

        imageProcessing.whiteBalanceMode: CameraImageProcessing.WhiteBalanceFlash

        exposure {
            exposureCompensation: -1.0
            exposureMode: Camera.ExposurePortrait
        }

        flash.mode: Camera.FlashRedEyeReduction

        imageCapture {
            onImageCaptured: {
                photoPreview.source = preview  // Show the preview in an Image
            }
        }
    }

    VideoOutput {
        source: camera
        anchors.fill: parent
        focus : visible // to receive focus and capture key events when visible
    }

    Image {
        id: photoPreview
    }
}

错误提示:(requestService(): no service found for - "org.qt-project.qt.camera")

解决方式:

QT的pro文件中添加 qt+=multimedia

添加权限如下图片

QT for IOS 相机错误(requestService(): no service found for - "org.qt-project.qt.camera")