Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Unable to run the "QML Recorder Example" demo on Mac
Forum Updated to NodeBB v4.3 + New Features

Unable to run the "QML Recorder Example" demo on Mac

Scheduled Pinned Locked Moved Solved QML and Qt Quick
13 Posts 3 Posters 810 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    robertwilliamallen
    wrote on last edited by
    #1

    Hello all,

    I'm trying to run the "QML Recorder Example" on MacOS I get:

    /Users/robert/Qt/Examples/Qt-6.3.1/multimedia/video/build-recorder-Qt_6_3_1_for_macOS-Debug/recorder.app/Contents/MacOS/recorder crashed.
    

    If I run in debug mode, I do get this window opening but it hangs:
    Screen Shot 2022-08-01 at 1.52.00 PM.png

    Here's the debug output:

    got fallback qt version 0x60301
    QML debugging is enabled. Only use this in a safe environment.
    2022-08-01 13:46:08.431204-0500 recorder[10631:383364] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=10631
    2022-08-01 13:46:08.431459-0500 recorder[10631:383364] SecTaskCopyDebugDescription: recorder[10631]/0#-1 LF=0
    2022-08-01 13:46:08.675182-0500 recorder[10631:383418] QML Debugger: Waiting for connection on port 54261...
    2022-08-01 13:46:10.948426-0500 recorder[10631:383364] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600000244840> F8BB1C28-BAE8-11D6-9C31-00039315CD46
    2022-08-01 13:46:10.999007-0500 recorder[10631:383364] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600000236c60> 30010C1C-93BF-11D8-8B5B-000A95AF9C6A
    2022-08-01 13:46:11.029338-0500 recorder[10631:383364]  HALC_ShellObject::HasProperty: initial inner method call failed, Error: 560947818 (!obj)
    2022-08-01 13:46:11.030710-0500 recorder[10631:383364]  HALC_ShellObject::HasProperty: initial inner method call failed, Error: 560947818 (!obj)
    2022-08-01 13:46:11.030734-0500 recorder[10631:383364]  HALC_ShellObject::HasProperty: initial inner method call failed, Error: 560947818 (!obj)
    2022-08-01 13:46:11.030970-0500 recorder[10631:383364]  HALC_ShellObject::HasProperty: initial inner method call failed, Error: 560947818 (!obj)
    2022-08-01 13:46:11.030995-0500 recorder[10631:383364]  HALC_ShellObject::HasProperty: initial inner method call failed, Error: 560947818 (!obj)
    2022-08-01 13:46:11.032126-0500 recorder[10631:383364]  HALC_ShellObject::HasProperty: initial inner method call failed, Error: 560947818 (!obj)
    2022-08-01 13:46:11.036269-0500 recorder[10631:383364]  HALC_ShellObject::HasProperty: initial inner method call failed, Error: 560947818 (!obj)
    2022-08-01 13:46:12.652846-0500 recorder[10631:383528] [] CMIO_Unit_Converter_Audio.cpp:590:RebuildAudioConverter AudioConverterSetProperty(dbca) failed (1886547824)
    2022-08-01 13:46:12.724038-0500 recorder[10631:383364] qrc:/qt-project.org/imports/QtQuick/Controls/macOS/ComboBox.qml:47: TypeError: Property 'styleFont' of object StyleRectangle_QMLTYPE_1(0x600003b01340) is not a function
    2022-08-01 13:46:12.724074-0500 recorder[10631:383364] qrc:/qt-project.org/imports/QtQuick/Controls/macOS/ComboBox.qml:47: TypeError: Property 'styleFont' of object StyleRectangle_QMLTYPE_1(0x600003b010a0) is not a function
    2022-08-01 13:46:12.724086-0500 recorder[10631:383364] qrc:/qt-project.org/imports/QtQuick/Controls/macOS/Button.qml:47: TypeError: Property 'styleFont' of object StyleRectangle_QMLTYPE_1(0x600003b0fb80) is not a function
    2022-08-01 13:46:12.724098-0500 recorder[10631:383364] qrc:/qt-project.org/imports/QtQuick/Controls/macOS/Button.qml:47: TypeError: Property 'styleFont' of object StyleRectangle_QMLTYP
    E_1(0x600003b0f9c0) is not a function
    2022-08-01 13:46:12.724114-0500 recorder[10631:383364] qrc:/qt-project.org/imports/QtQuick/Controls/macOS/ComboBox.qml:47: TypeError: Property 'styleFont' of object StyleRectangle_QMLTYPE_1(0x600003b0f800) is not a function
    2022-08-01 13:46:12.724144-0500 recorder[10631:383364] qrc:/qt-project.org/imports/QtQuick/Controls/macOS/ComboBox.qml:47: TypeError: Property 'styleFont' of object StyleRectangle_QMLTYPE_1(0x600003b0f640) is not a function
    2022-08-01 13:46:12.724166-0500 recorder[10631:383364] qrc:/qt-project.org/imports/QtQuick/Controls/macOS/ComboBox.qml:47: TypeError: Property 'styleFont' of object StyleRectangle_QMLTYPE_1(0x600003b0f3a0) is not a function
    2022-08-01 13:46:12.724183-0500 recorder[10631:383364] qrc:/qt-project.org/imports/QtQuick/Controls/macOS/ComboBox.qml:47: TypeError: Property 'styleFont' of object StyleRectangle_QMLTYPE_1(0x600003b0f100) is not a function
    2022-08-01 13:46:12.724196-0500 recorder[10631:383364] qrc:/qt-project.org/imports/Qt
    Quick/Controls/macOS/ComboBox.qml:47: TypeError: Property 'styleFont' of object StyleRectangle_QMLTYPE_1(0x600003b0ee60) is not a function
    2022-08-01 13:46:12.724212-0500 recorder[10631:383364] qrc:/qt-project.org/imports/QtQuick/Controls/macOS/Button.qml:47: TypeError: Property 'styleFont' of object StyleRectangle_QMLTYPE_1(0x600003b0eca0) is not a function
    

    Any idea what is going on?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Did you get a request to allow the use of the microphone ?
      Usually you would need to add an entry to your application .plist file that explains why your users shall grant that privilege.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        robertwilliamallen
        wrote on last edited by
        #3

        Hi @SGaist , I was not prompted to allow microphone access. I also don't see a .plist file in the directory. I am able to run the widgets "Camera Example" and that one does prompt for microphone and does include a .plist file.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Then for the test, I would grab the .plist from that example and copy it to the app bundle of the other one.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • R Offline
            R Offline
            robertwilliamallen
            wrote on last edited by
            #5

            I don't think that will work. I'm noticing with the "Camera Example" it has a .pro file which I believe is coming from qmake. While the "QML Recorder Example" has a CMakeLists.txt file, so it was built with CMake. So, I don't think I can add the "shared" folder to a CMake project. Does that make sense?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              MACOSX_BUNDLE_INFO_PLIST but I would copy and adapt the other plist file to match the application.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • R Offline
                R Offline
                robertwilliamallen
                wrote on last edited by
                #7

                Okay, I added this to the CMake config:

                Screen Shot 2022-08-01 at 3.13.23 PM.png

                And I am referencing a .plist file with this content:

                <?xml version="1.0" encoding="UTF-8"?>
                <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
                <plist version="1.0">
                <dict>
                        <key>CFBundleInfoDictionaryVersion</key>
                        <string>6.0</string>
                        <key>CFBundlePackageType</key>
                        <string>APPL</string>
                
                        <key>CFBundleName</key>
                        <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
                        <key>CFBundleIdentifier</key>
                        <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
                        <key>CFBundleExecutable</key>
                        <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
                
                        <key>CFBundleVersion</key>
                        <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
                        <key>CFBundleShortVersionString</key>
                        <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
                        <key>CFBundleLongVersionString</key>
                        <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
                
                        <key>LSMinimumSystemVersion</key>
                        <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
                
                        <key>CFBundleGetInfoString</key>
                        <string>${MACOSX_BUNDLE_INFO_STRING}</string>
                        <key>NSHumanReadableCopyright</key>
                        <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
                
                        <key>CFBundleIconFile</key>
                        <string>${MACOSX_BUNDLE_ICON_FILE}</string>
                
                        <key>CFBundleDevelopmentRegion</key>
                        <string>English</string>
                
                        <key>NSCameraUsageDescription</key>
                        <string>Qt Multimedia Example</string>
                        <key>NSMicrophoneUsageDescription</key>
                        <string>Qt Multimedia Example</string>
                        <key>com.apple.security.device.audio-input</key>
                        <string>Qt Multimedia Example</string>
                
                        <key>NSSupportsAutomaticGraphicsSwitching</key>
                        <true/>
                </dict>
                </plist>
                

                Now when I run in debug mode I am seeing:

                2022-08-01 15:14:42.879870-0500 recorder[12848:436078] User has denied access to microphone
                2022-08-01 15:14:42.879901-0500 recorder[12848:436078] User has denied access to camera
                

                But I never see any prompts for camera or microphone.

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  robertwilliamallen
                  wrote on last edited by
                  #8

                  My bad, the full .plist content was cut off. Here's the relevant part:

                          <key>NSCameraUsageDescription</key>
                          <string>Qt Multimedia Example</string>
                          <key>NSMicrophoneUsageDescription</key>
                          <string>Qt Multimedia Example</string>
                          <key>com.apple.security.device.audio-input</key>
                          <string>Qt Multimedia Example</string>
                  
                  D 1 Reply Last reply
                  0
                  • R robertwilliamallen

                    My bad, the full .plist content was cut off. Here's the relevant part:

                            <key>NSCameraUsageDescription</key>
                            <string>Qt Multimedia Example</string>
                            <key>NSMicrophoneUsageDescription</key>
                            <string>Qt Multimedia Example</string>
                            <key>com.apple.security.device.audio-input</key>
                            <string>Qt Multimedia Example</string>
                    
                    D Offline
                    D Offline
                    DerReisende
                    wrote on last edited by
                    #9

                    @robertwilliamallen do you have com.apple.security.device.audio-input entitlement in your binary?

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      robertwilliamallen
                      wrote on last edited by
                      #10

                      @DerReisende I'm new to Qt so I don't know if I do or not. How would I check?

                      D 1 Reply Last reply
                      0
                      • R robertwilliamallen

                        @DerReisende I'm new to Qt so I don't know if I do or not. How would I check?

                        D Offline
                        D Offline
                        DerReisende
                        wrote on last edited by
                        #11

                        @robertwilliamallen macOS got really bad when it comes to code signing and all that entitlement stuff, especially if you use the modern Apple Silicon CPU Macs. I couldn‘t really figure out how to do that stuff without help.
                        First you should use the Xcode generator for CMake, then use the latest CMake version you can get.
                        Then you could specify in your CMakeLists.txt something like the following:

                        set_target_properties(MyApp PROPERTIES    XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${CMAKE_CURRENT_LIST_DIR}/MyApp.entitlements )
                        

                        You should read the Apple Documentation regarding Hardened Runtime and Entitlements, e.g. here.
                        You could also create a dummy xcode swift app and look for a tutorial about entitlements and create a proper file in there and copy that to your qt app.

                        One thing that REALLY helped me a lot getting a working Qt mac app done on my system was the following book I bought: Professional CMake. Chapter 23 „Apple Features“ has been really helpful. The above code snippet is part of the book.

                        BTW I just saw in your screenshot that you got a SecTaskLoadEntitlement error so I would guess I am not too far of with my entitlements guess.

                        R 1 Reply Last reply
                        1
                        • D DerReisende

                          @robertwilliamallen macOS got really bad when it comes to code signing and all that entitlement stuff, especially if you use the modern Apple Silicon CPU Macs. I couldn‘t really figure out how to do that stuff without help.
                          First you should use the Xcode generator for CMake, then use the latest CMake version you can get.
                          Then you could specify in your CMakeLists.txt something like the following:

                          set_target_properties(MyApp PROPERTIES    XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${CMAKE_CURRENT_LIST_DIR}/MyApp.entitlements )
                          

                          You should read the Apple Documentation regarding Hardened Runtime and Entitlements, e.g. here.
                          You could also create a dummy xcode swift app and look for a tutorial about entitlements and create a proper file in there and copy that to your qt app.

                          One thing that REALLY helped me a lot getting a working Qt mac app done on my system was the following book I bought: Professional CMake. Chapter 23 „Apple Features“ has been really helpful. The above code snippet is part of the book.

                          BTW I just saw in your screenshot that you got a SecTaskLoadEntitlement error so I would guess I am not too far of with my entitlements guess.

                          R Offline
                          R Offline
                          robertwilliamallen
                          wrote on last edited by
                          #12

                          @DerReisende Thanks so much for the help. I will try your suggestions.

                          1 Reply Last reply
                          0
                          • R Offline
                            R Offline
                            robertwilliamallen
                            wrote on last edited by
                            #13

                            Well, it looks like if I click "Run in terminal" it runs correctly as per this:
                            https://bugreports.qt.io/browse/QTCREATORBUG-23880

                            1 Reply Last reply
                            0

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved