Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Frameworks issues with MacOS notarization
QtWS25 Last Chance

Qt Frameworks issues with MacOS notarization

Scheduled Pinned Locked Moved Solved General and Desktop
macosframework
15 Posts 5 Posters 2.8k Views
  • 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.
  • P Offline
    P Offline
    p_Each
    wrote on last edited by
    #1

    We are currently trying to have our app verified in order to distribute it outside of the app store. We are including OpenSceneGraph libraries as well as Qt frameworks in the app bundle.

    This is how we did it so far:

    • Signed executable in Contents/MacOS folder

    • Signed libraries and Qt frameworks

    • Signed App.app folder

    • zipped .app and submitted for Notarization

    The executable, libraries and frameworks signing is done manually with the codesign command, and to sign the whole .app we do the following:

    codesign --force --verify --verbose=3 --options runtime --timestamp --entitlements App.entitlements -s "Developer ID Application: Our Dev Id" App.app
    

    When we send the zipped .app to be notarized we usually get a quick reply informing us that the notarization was successful, but if we try to run

    spctl --verbose --assess --type execute -v App.app
    

    we get the following error:

    App.app: rejected (unsealed contents present in the root directory of an embedded framework)

    Also inspecting the json file with the notarization output we notice the same error, but it is marked as a warning and checking it with codesign no error is returned.

    After a bit of digging we realized that the issue is related to the Qt frameworks: as a counterproof, we tried to submit the same app without the Qt frameworks and this time when the bundle was successfully notarized spctl accepted it too.
    Consequently we eliminated the all symlinks in the root directory, moved the .prl files into the Resources/ folder, and created an alias to A/ in the Versions/ subfolder as suggested in several forum posts, but we have not been able to have spctl accept our bundle with the Qt frameworks. Now at the root of each framework there is just the Versions folder and nothing else (we checked with ls-lha to be sure)

    What are we missing in this? Is there a way to at least get some hint on where is the unsealed content which is upsetting the verification tool?

    Thank you in advance

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

      Can you check with the windeployqt version coming with the latest Qt 5.14 ?
      Note that Qt 5.12.7 has been released, you might also want to upgrade.

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

      P A 2 Replies Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi and welcome to devnet,

        What version of Qt are you using ?

        Did you check if there was any hidden files (those starting with a dot) in the frameworks ?

        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
        • P Offline
          P Offline
          p_Each
          wrote on last edited by
          #3

          Hi, thank you for your answer. I am using Qt 5.12.2 and yes, I did check for hidden files but even when I removed them the issue persisted.

          What I have saw from other tests I made in the meantime is that if I structure a framework in a way more "Apple-like" (meaning that the Versions folder contain an A folder and a Current symlink pointing to A instead of a 5) the bundle is correctly signed and validated.

          Unfortunately it does not run because there are some runpaths of some framework which I have not been able to correct with install_name_tool command and are still set to QtFramework/Versions/5/QtFramework instead of QtFramework/Versions/A/QtFramework.

          We have always been able to build the app with the qt frameworks but since we upgraded to Mojave 10.14.6 we need to sign (and from next month on) t notarize our app bundle to successfully distribute it outside the App Store

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

            Looks like there's something related on the bug report system

            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
            1
            • P Offline
              P Offline
              p_Each
              wrote on last edited by
              #5

              Hello, thanks for the link you provided, but they did not solve our issue.
              We are now trying to go down the macdeployqt path, but there must be something going on when it copies the Qt Frameworks in the Contents/Frameworks/ folder because somehow it skips (at least) one of the required frameworks.

              At this point there are a few things I need to figure out: how does macdeployqt know which frameworks need to be copied inside the bundle? I have checked in the output of otool -L command and the framework is listed there. Is it anything I must check somewhere else? Is it possible to specify manually which frameworks we want to add? Is it something we need to check in our .cmake files?

              Thank you again

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

                macdeployqt uses macOS tools to gather the required information. What was the missing framework ?

                Recent version of the tool got fixed with regard to some missing framework or plugins.

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

                P 1 Reply Last reply
                1
                • SGaistS SGaist

                  macdeployqt uses macOS tools to gather the required information. What was the missing framework ?

                  Recent version of the tool got fixed with regard to some missing framework or plugins.

                  P Offline
                  P Offline
                  p_Each
                  wrote on last edited by
                  #7

                  @SGaist QtOpenGL. It caused the macdeployqt command to fail during the signing process, so I tried to add it manually (using cp -R command) and to re-sign the bundle calling codesign but it gave the "unsealed contents" error again.
                  This is why I asked if there is a way to specify manually the frameworks to be added by macdeployqt or a way to figure out why it is not adding it

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

                    Can you check with the windeployqt version coming with the latest Qt 5.14 ?
                    Note that Qt 5.12.7 has been released, you might also want to upgrade.

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

                    P A 2 Replies Last reply
                    1
                    • SGaistS SGaist

                      Can you check with the windeployqt version coming with the latest Qt 5.14 ?
                      Note that Qt 5.12.7 has been released, you might also want to upgrade.

                      P Offline
                      P Offline
                      p_Each
                      wrote on last edited by
                      #9

                      @SGaist I just tried with Qt 5.14.1 and this time macdeployqt was successful. There are still some notarization issues with the hardened runtime and some default entitlements I granted to the app but at least the frameworks look in place now. Thank you for your help

                      1 Reply Last reply
                      0
                      • sierdzioS Offline
                        sierdzioS Offline
                        sierdzio
                        Moderators
                        wrote on last edited by
                        #10

                        Not sure if it will help in anything, but I used this script on a .dmg and it works well (although not reliably - Apple randomly rejects notarization calls, but it's usually to wait a bit and run it again).

                        (Z(:^

                        P 1 Reply Last reply
                        2
                        • sierdzioS sierdzio

                          Not sure if it will help in anything, but I used this script on a .dmg and it works well (although not reliably - Apple randomly rejects notarization calls, but it's usually to wait a bit and run it again).

                          P Offline
                          P Offline
                          p_Each
                          wrote on last edited by
                          #11

                          @sierdzio thanks. My notarizations issues after switching to the latest Qt version were easier to solve fortunately, I only had forgotten to enable the Hardened Runtime and to put a timestamp when signing the bundle

                          1 Reply Last reply
                          0
                          • SGaistS SGaist

                            Can you check with the windeployqt version coming with the latest Qt 5.14 ?
                            Note that Qt 5.12.7 has been released, you might also want to upgrade.

                            A Offline
                            A Offline
                            angadhanoa
                            wrote on last edited by angadhanoa
                            #12

                            @SGaist and @p_Each, i am facing the same problem. I have tried this in 5.12.4 and 5.14.1. The entire application gets code signed but notarization and sptcl fails because of "unsealed contents present in the root directory of an embedded framework". Spctl specifically mentions unsealed contents and when i try "codesign --verify --verbose=4 --deep" on any Qt framework. I have also tried verifying every component of the framework using the codesign command in the framework but it states that they are valid on disk and satisfies its Designated Requirement. The only file which has no code-signature in the framework is the CodeResources file created by the codesign itself and placed in the _CodeSignature folder.

                            I have created the following symbolic links:

                            QtGui.framework
                            |_ QtGui -> Versions/Current/QtGui
                            |_ Resources -> Versions/Current/Resources
                               |_ Info.plist
                            |_ Versions
                               |_ 5
                                  |_ QtGui
                                  |_ Resources
                                  |_ _CodeSignature
                                     |_ CodeResources
                                |_ A -> 5 
                                |_ Current -> 5
                            

                            Codesign command:

                            "codesign --force --verify --verbose --entitlements 'abc.plist' --sign 'Developer ID Application: ABC (XYZ)' --timestamp --options=runtime --strict QtGui.framework/Versions/5 "
                            
                            SGaistS 1 Reply Last reply
                            0
                            • A angadhanoa

                              @SGaist and @p_Each, i am facing the same problem. I have tried this in 5.12.4 and 5.14.1. The entire application gets code signed but notarization and sptcl fails because of "unsealed contents present in the root directory of an embedded framework". Spctl specifically mentions unsealed contents and when i try "codesign --verify --verbose=4 --deep" on any Qt framework. I have also tried verifying every component of the framework using the codesign command in the framework but it states that they are valid on disk and satisfies its Designated Requirement. The only file which has no code-signature in the framework is the CodeResources file created by the codesign itself and placed in the _CodeSignature folder.

                              I have created the following symbolic links:

                              QtGui.framework
                              |_ QtGui -> Versions/Current/QtGui
                              |_ Resources -> Versions/Current/Resources
                                 |_ Info.plist
                              |_ Versions
                                 |_ 5
                                    |_ QtGui
                                    |_ Resources
                                    |_ _CodeSignature
                                       |_ CodeResources
                                  |_ A -> 5 
                                  |_ Current -> 5
                              

                              Codesign command:

                              "codesign --force --verify --verbose --entitlements 'abc.plist' --sign 'Developer ID Application: ABC (XYZ)' --timestamp --options=runtime --strict QtGui.framework/Versions/5 "
                              
                              SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #13

                              @angadhanoa hi and welcome to devnet,

                              IIRC, there was a thread recently about the same issue which was solved. Keep searching the forum.

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

                              A 1 Reply Last reply
                              0
                              • SGaistS SGaist

                                @angadhanoa hi and welcome to devnet,

                                IIRC, there was a thread recently about the same issue which was solved. Keep searching the forum.

                                A Offline
                                A Offline
                                angadhanoa
                                wrote on last edited by
                                #14

                                @SGaist Thanks, I will. This is giving me a lot of headache. At first i was thinking that i have the same issue but that was not it. Once again, thank you. i will try to find that thread.

                                1 Reply Last reply
                                0
                                • SprezzaturaS Offline
                                  SprezzaturaS Offline
                                  Sprezzatura
                                  wrote on last edited by
                                  #15

                                  We had a similar problem. There does not appear to be any purpose for a lot of the stuff that Qt Creator piles into the ".app" file, and it interferes with Apple Notarization.

                                  We solved the problem by simply creating a command file that deletes the conflicting files:

                                  # Clean out detritus that prevents notarization
                                  cd foo.app
                                  find . -name "*.h" -delete
                                  find . -name "*.prl" -delete
                                  find . -name "*.cstemp" -delete
                                  find . -name "Headers" -delete
                                  find ./ -name "*_debug" -delete
                                  
                                  1 Reply Last reply
                                  1

                                  • Login

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