Deploy Qt4 Framework on Mac does not sign



  • Hello Guys,

    I have an application created with Qt 4.8.7_2 installed with Brew on Mac
    it needs the Frameworks inside the bundle
    The output with macdeployqt runs fine
    But as you may know there is a new structure for the Frameworks to get verified by Apple and it is not implied in Qt4.8. People created some scripts that restructure this Framework. For example the script here link text it restructures the framework but the output does not run any more, the application produces an error.
    Could any body help me with this issue or do it manually?

    thanks


  • Lifetime Qt Champion

    Hi,

    What error are you getting ?



  • After i restructure with the script, i get error starting the package with ignore and report to apple .. When i replace the framework with old ones it works again. I need to do the restructure manual
    my bundle is as follows:
    -content
    -->Info.plist
    -->pkginfo
    -->MACOS
    -->Resources
    -->Frameworks
    ------>QtCore.framework
    ------------> Resources------------>empty
    ------------> Versions------------>4------------>Qtcore
    ------>QtGui.framework
    ------------> Resources------------>qtmenu.nib
    ------------> Versions------------>4------------>QtGui
    ------>QtSql.framework
    ------------> Resources------------>empty
    ------------> Versions------------>4------------>QtSql
    ------>QtNetwork.framework
    ------------> Resources------------>empty
    ------------> Versions------------>4------------>QtNetwork
    -->Plugins (acessible, bearer, codec, imageformats, sqldriver)


  • Lifetime Qt Champion

    You will probably have to run install_name_tool to make sure your libraries are found again by the application. Run otool -L on your application and you'll see what it can't find with your new structure.



  • I restructured the frameworks now and it runs.
    I forgot to inform you that inside the frameworks folder, i ve also
    libcrypto.1.0.0.dylib
    libssl.1.0.0.dylib

    when i do make codesign .. I get
    In subcomponent: /app/build-login-QT_4_8_7-Release/MyApp.app/Contents/Frameworks/libcrypto.1.0.0.dylib
    make: *** [codesign] Error 1

    When i give otool -l Myapp (inside the bundle) I get

    Sherif:MacOS sherifomran$ otool -l MyApp 
    MyApp:
    Load command 0
          cmd LC_SEGMENT_64
      cmdsize 72
      segname __PAGEZERO
       vmaddr 0x0000000000000000
       vmsize 0x0000000100000000
      fileoff 0
     filesize 0
      maxprot 0x00000000
     initprot 0x00000000
       nsects 0
        flags 0x0
    Load command 1
          cmd LC_SEGMENT_64
      cmdsize 712
      segname __TEXT
       vmaddr 0x0000000100000000
       vmsize 0x000000000047c000
      fileoff 0
     filesize 4702208
      maxprot 0x00000007
     initprot 0x00000005
       nsects 8
        flags 0x0
    Section
      sectname __text
       segname __TEXT
          addr 0x00000001000026f0
          size 0x00000000000a76f8
        offset 9968
         align 2^4 (16)
        reloff 0
        nreloc 0
         flags 0x80000400
     reserved1 0
     reserved2 0
    Section
      sectname __stubs
       segname __TEXT
          addr 0x00000001000a9de8
          size 0x00000000000012ea
        offset 695784
         align 2^1 (2)
        reloff 0
        nreloc 0
         flags 0x80000408
     reserved1 0 (index into indirect symbol table)
     reserved2 6 (size of stubs)
    Section
      sectname __stub_helper
       segname __TEXT
          addr 0x00000001000ab0d4
          size 0x00000000000025d4
        offset 700628
         align 2^2 (4)
        reloff 0
        nreloc 0
         flags 0x80000400
     reserved1 0
     reserved2 0
    Section
      sectname __gcc_except_tab
       segname __TEXT
          addr 0x00000001000ad6a8
          size 0x000000000001fcc4
        offset 710312
         align 2^2 (4)
        reloff 0
        nreloc 0
         flags 0x00000000
     reserved1 0
     reserved2 0
    Section
      sectname __const
       segname __TEXT
          addr 0x00000001000cd370
          size 0x0000000000391a7e
        offset 840560
         align 2^4 (16)
        reloff 0
        nreloc 0
         flags 0x00000000
     reserved1 0
     reserved2 0
    Section
      sectname __cstring
       segname __TEXT
          addr 0x000000010045edee
          size 0x0000000000007900
        offset 4582894
         align 2^0 (1)
        reloff 0
        nreloc 0
         flags 0x00000002
     reserved1 0
     reserved2 0
    Section
      sectname __unwind_info
       segname __TEXT
          addr 0x00000001004666f0
          size 0x00000000000023fc
        offset 4613872
         align 2^2 (4)
        reloff 0
        nreloc 0
         flags 0x00000000
     reserved1 0
     reserved2 0
    Section
      sectname __eh_frame
       segname __TEXT
          addr 0x0000000100468af0
          size 0x0000000000013508
        offset 4623088
         align 2^3 (8)
        reloff 0
        nreloc 0
         flags 0x00000000
     reserved1 0
     reserved2 0
    Load command 2
          cmd LC_SEGMENT_64
      cmdsize 712
      segname __DATA
       vmaddr 0x000000010047c000
       vmsize 0x0000000000007000
      fileoff 4702208
     filesize 24576
      maxprot 0x00000007
     initprot 0x00000003
       nsects 8
        flags 0x0
    Section
      sectname __dyld
       segname __DATA
          addr 0x000000010047c000
          size 0x0000000000000038
        offset 4702208
         align 2^3 (8)
        reloff 0
        nreloc 0
         flags 0x00000000
     reserved1 0
     reserved2 0
    Section
      sectname __got
       segname __DATA
          addr 0x000000010047c038
          size 0x00000000000000b8
        offset 4702264
         align 2^3 (8)
        reloff 0
        nreloc 0
         flags 0x00000006
     reserved1 807 (index into indirect symbol table)
     reserved2 0
    Section
      sectname __la_symbol_ptr
       segname __DATA
          addr 0x000000010047c0f0
          size 0x0000000000001938
        offset 4702448
         align 2^3 (8)
        reloff 0
        nreloc 0
         flags 0x00000007
     reserved1 830 (index into indirect symbol table)
     reserved2 0
    Section
      sectname __mod_init_func
       segname __DATA
          addr 0x000000010047da28
          size 0x0000000000000050
        offset 4708904
         align 2^3 (8)
        reloff 0
        nreloc 0
         flags 0x00000009
     reserved1 0
     reserved2 0
    Section
      sectname __const
       segname __DATA
          addr 0x000000010047da80
          size 0x0000000000004108
        offset 4708992
         align 2^4 (16)
        reloff 0
        nreloc 0
         flags 0x00000000
     reserved1 0
     reserved2 0
    Section
      sectname __data
       segname __DATA
          addr 0x0000000100481b88
          size 0x0000000000000080
        offset 4725640
         align 2^2 (4)
        reloff 0
        nreloc 0
         flags 0x00000000
     reserved1 0
     reserved2 0
    Section
      sectname __common
       segname __DATA
          addr 0x0000000100481c10
          size 0x0000000000000451
        offset 0
         align 2^4 (16)
        reloff 0
        nreloc 0
         flags 0x00000001
     reserved1 0
     reserved2 0
    Section
      sectname __bss
       segname __DATA
          addr 0x0000000100482064
          size 0x0000000000000004
        offset 0
         align 2^2 (4)
        reloff 0
        nreloc 0
         flags 0x00000001
     reserved1 0
     reserved2 0
    Load command 3
          cmd LC_SEGMENT_64
      cmdsize 72
      segname __LINKEDIT
       vmaddr 0x0000000100483000
       vmsize 0x000000000006a000
      fileoff 4726784
     filesize 431532
      maxprot 0x00000007
     initprot 0x00000001
       nsects 0
        flags 0x0
    Load command 4
         cmd LC_SYMTAB
     cmdsize 24
      symoff 4729152
       nsyms 11630
      stroff 4931300
     strsize 227016
    Load command 5
                cmd LC_DYSYMTAB
            cmdsize 80
          ilocalsym 0
          nlocalsym 8844
         iextdefsym 8844
         nextdefsym 1978
          iundefsym 10822
          nundefsym 808
             tocoff 0
               ntoc 0
          modtaboff 0
            nmodtab 0
       extrefsymoff 0
        nextrefsyms 0
     indirectsymoff 4924752
      nindirectsyms 1637
          extreloff 4915232
            nextrel 1190
          locreloff 0
            nlocrel 0
    Load command 6
              cmd LC_LOAD_DYLINKER
          cmdsize 32
             name /usr/lib/dyld (offset 12)
    Load command 7
         cmd LC_UUID
     cmdsize 24
        uuid 305D65BE-AD64-3D67-A609-527988D596A1
    Load command 8
          cmd LC_VERSION_MIN_MACOSX
      cmdsize 16
      version 10.5
          sdk 10.11
    Load command 9
            cmd LC_UNIXTHREAD
        cmdsize 184
         flavor x86_THREAD_STATE64
          count x86_THREAD_STATE64_COUNT
       rax  0x0000000000000000 rbx 0x0000000000000000 rcx  0x0000000000000000
       rdx  0x0000000000000000 rdi 0x0000000000000000 rsi  0x0000000000000000
       rbp  0x0000000000000000 rsp 0x0000000000000000 r8   0x0000000000000000
        r9  0x0000000000000000 r10 0x0000000000000000 r11  0x0000000000000000
       r12  0x0000000000000000 r13 0x0000000000000000 r14  0x0000000000000000
       r15  0x0000000000000000 rip 0x00000001000026f0
    rflags  0x0000000000000000 cs  0x0000000000000000 fs   0x0000000000000000
        gs  0x0000000000000000
    Load command 10
              cmd LC_LOAD_DYLIB
          cmdsize 88
             name @executable_path/../Frameworks/QtSql.framework/Versions/4/QtSql (offset 24)
       time stamp 2 Thu Jan  1 01:00:02 1970
          current version 4.8.7
    compatibility version 4.8.0
    Load command 11
              cmd LC_LOAD_DYLIB
          cmdsize 96
             name @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (offset 24)
       time stamp 2 Thu Jan  1 01:00:02 1970
          current version 4.8.7
    compatibility version 4.8.0
    Load command 12
              cmd LC_LOAD_DYLIB
          cmdsize 88
             name @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (offset 24)
       time stamp 2 Thu Jan  1 01:00:02 1970
          current version 4.8.7
    compatibility version 4.8.0
    Load command 13
              cmd LC_LOAD_DYLIB
          cmdsize 96
             name @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork (offset 24)
       time stamp 2 Thu Jan  1 01:00:02 1970
          current version 4.8.7
    compatibility version 4.8.0
    Load command 14
              cmd LC_LOAD_DYLIB
          cmdsize 56
             name /usr/lib/libstdc++.6.dylib (offset 24)
       time stamp 2 Thu Jan  1 01:00:02 1970
          current version 104.1.0
    compatibility version 7.0.0
    Load command 15
              cmd LC_LOAD_DYLIB
          cmdsize 56
             name /usr/lib/libSystem.B.dylib (offset 24)
       time stamp 2 Thu Jan  1 01:00:02 1970
          current version 1226.10.1
    compatibility version 1.0.0
    Load command 16
              cmd LC_LOAD_DYLIB
          cmdsize 56
             name /usr/lib/libgcc_s.1.dylib (offset 24)
       time stamp 2 Thu Jan  1 01:00:02 1970
          current version 913.0.0
    compatibility version 1.0.0
    Load command 17
          cmd LC_FUNCTION_STARTS
      cmdsize 16
      dataoff 4726784
     datasize 2368
    Load command 18
          cmd LC_DATA_IN_CODE
      cmdsize 16
      dataoff 4729152
     datasize 0
    Sherif:MacOS sherifomran$ 
    
    

    It seems, frameworks are place correct and found correct but can not codesign.
    If i convert the pro file to xcode and open in xcode, it builds, archives, and when i verify, it complains about the frameworks (because they was old structure), did not ty with new structure. I updated Xcode today to 7.2.1


  • Lifetime Qt Champion

    You have a casing issue. It's -L not -l that you should use.



  • @SGaist thanks for the note

    otool -L MyApp
    ...
    MyApp:
    @executable_path/../Frameworks/QtSql.framework/Versions/4/QtSql (compatibility version 4.8.0, current version 4.8.7)
    @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.7)
    @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.8.0, current version 4.8.7)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 104.1.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 913.0.0)
    Sherif:MacOS sherifomran$
    ...


  • Lifetime Qt Champion

    That part looks good. Do the same with the Qt Frameworks and the OpenSSL related libraries.



  • @SGaist Sorry, i don't understand what you mean.
    Do you mean, Should i restructure the following libraries in Frameworks folder?
    libcrypto.1.0.0.dylib
    libssl.1.0.0.dylib
    or should i try to add the following libraries to the frameworks folder?
    libstdc++.6.dylib
    libSystem.B.dylib
    libgcc_s.1.dylib
    I don't know how to restructure the dylib file?


  • Lifetime Qt Champion

    Never put system libraries in your app bundle.

    I meant check that all your frameworks also find their dependencies. e.g. QtNetwork will probably look after libssl and libcrypto if you rebuilt your Qt against them.



  • Here is the output of otool -L with libraries and frameworks inside the framework folder, i ve also a plugin folder, should i test it ?

    For QTNetwork

    Sherif:QtNetwork.framework sherifomran$ otool -L QtNetwork 
    QtNetwork:
    	@executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.8.0, current version 4.8.7)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
    	/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (compatibility version 1.0.0, current version 802.20.7)
    	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1256.14.0)
    	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 728.6.0)
    	@executable_path/../Frameworks/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    	@executable_path/../Frameworks/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    
    

    For QtCore

    Sherif:QtCore.framework sherifomran$ otool -L QtCore
    QtCore:
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 48.0.0)
    	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1256.14.0)
    	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 57337.20.43)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 728.6.0)
    

    QTGui

    Sherif:QtGui.framework sherifomran$ otool -L QtGui 
    QtGui:
    	@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.7)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 157.0.0)
    	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
    	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1404.32.0)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 48.0.0)
    	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1256.14.0)
    	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 728.6.0)
    	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1256.1.0)
    	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    Sherif:QtGui.framework sherifomran$ 
    
    

    for QtSql

    Sherif:QtSql.framework sherifomran$ otool -L QtSql 
    QtSql:
    	@executable_path/../Frameworks/QtSql.framework/Versions/4/QtSql (compatibility version 4.8.0, current version 4.8.7)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    Sherif:QtSql.framework sherifomran$ 
    

    for LibCrypto

    Sherif:Frameworks sherifomran$ otool -L libcrypto.1.0.0.dylib 
    libcrypto.1.0.0.dylib:
    	@executable_path/../Frameworks/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    
    

    For Libssl

    Sherif:Frameworks sherifomran$ otool -L libssl.1.0.0.dylib 
    libssl.1.0.0.dylib:
    	@executable_path/../Frameworks/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    	@executable_path/../Frameworks/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    
    

  • Lifetime Qt Champion

    In that case do you have both libssl and libcrypto in the Frameworks folder ?

    Yes, you should also check your plugins.



  • @SGaist
    Yes i have libssl and libcrypto in the Frameworks
    The following is plugin check, seems ok with all of them or do you notice something which i don't notice?

    Plugin Check

    Sherif:PlugIns sherifomran$ cd accessible/
    Sherif:accessible sherifomran$ ls
    libqtaccessiblewidgets.dylib
    Sherif:accessible sherifomran$ otool -L libqtaccessiblewidgets.dylib 
    libqtaccessiblewidgets.dylib:
    	/usr/local/opt/qt/plugins/accessible/libqtaccessiblewidgets.dylib (compatibility version 0.0.0, current version 0.0.0)
    	@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.7)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    Sherif:accessible sherifomran$ 
    
    
    Sherif:PlugIns sherifomran$ otool -L bearer/libqcorewlanbearer.dylib 
    bearer/libqcorewlanbearer.dylib:
    	/usr/local/opt/qt/plugins/bearer/libqcorewlanbearer.dylib (compatibility version 0.0.0, current version 0.0.0)
    	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1256.1.0)
    	/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (compatibility version 1.0.0, current version 802.20.7)
    	/System/Library/Frameworks/CoreWLAN.framework/Versions/A/CoreWLAN (compatibility version 1.0.0, current version 1.0.0)
    	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 57337.20.43)
    	@executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.8.0, current version 4.8.7)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1256.14.0)
    	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    Sherif:PlugIns sherifomran$ otool -L bearer/libqgenericbearer.dylib 
    bearer/libqgenericbearer.dylib:
    	/usr/local/opt/qt/plugins/bearer/libqgenericbearer.dylib (compatibility version 0.0.0, current version 0.0.0)
    	@executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.8.0, current version 4.8.7)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    Sherif:PlugIns sherifomran$ 
    
    
    Sherif:PlugIns sherifomran$ otool -L codecs/libq
    libqcncodecs.dylib  libqjpcodecs.dylib  libqkrcodecs.dylib  libqtwcodecs.dylib
    Sherif:PlugIns sherifomran$ otool -L codecs/libqcncodecs.dylib 
    codecs/libqcncodecs.dylib:
    	/usr/local/opt/qt/plugins/codecs/libqcncodecs.dylib (compatibility version 0.0.0, current version 0.0.0)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    Sherif:PlugIns sherifomran$ otool -L codecs/libqjpcodecs.dylib 
    codecs/libqjpcodecs.dylib:
    	/usr/local/opt/qt/plugins/codecs/libqjpcodecs.dylib (compatibility version 0.0.0, current version 0.0.0)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    Sherif:PlugIns sherifomran$ otool -L codecs/libqkrcodecs.dylib 
    codecs/libqkrcodecs.dylib:
    	/usr/local/opt/qt/plugins/codecs/libqkrcodecs.dylib (compatibility version 0.0.0, current version 0.0.0)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    Sherif:PlugIns sherifomran$ otool -L codecs/libqtwcodecs.dylib 
    codecs/libqtwcodecs.dylib:
    	/usr/local/opt/qt/plugins/codecs/libqtwcodecs.dylib (compatibility version 0.0.0, current version 0.0.0)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    Sherif:PlugIns sherifomran$ 
    
    
    Sherif:PlugIns sherifomran$ otool -L imageformats/libq
    libqgif.dylib   libqjpeg.dylib  libqtga.dylib   
    libqico.dylib   libqmng.dylib   libqtiff.dylib  
    Sherif:PlugIns sherifomran$ otool -L imageformats/*.dylib
    imageformats/libqgif.dylib:
    	/usr/local/opt/qt/plugins/imageformats/libqgif.dylib (compatibility version 0.0.0, current version 0.0.0)
    	@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.7)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    imageformats/libqico.dylib:
    	/usr/local/opt/qt/plugins/imageformats/libqico.dylib (compatibility version 0.0.0, current version 0.0.0)
    	@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.7)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    imageformats/libqjpeg.dylib:
    	/usr/local/opt/qt/plugins/imageformats/libqjpeg.dylib (compatibility version 0.0.0, current version 0.0.0)
    	@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.7)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    imageformats/libqmng.dylib:
    	/usr/local/opt/qt/plugins/imageformats/libqmng.dylib (compatibility version 0.0.0, current version 0.0.0)
    	@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.7)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    imageformats/libqtga.dylib:
    	/usr/local/opt/qt/plugins/imageformats/libqtga.dylib (compatibility version 0.0.0, current version 0.0.0)
    	@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.7)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    imageformats/libqtiff.dylib:
    	/usr/local/opt/qt/plugins/imageformats/libqtiff.dylib (compatibility version 0.0.0, current version 0.0.0)
    	@executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.7)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    Sherif:PlugIns sherifomran$ 
    
    
    Sherif:PlugIns sherifomran$ otool -L sqldrivers/libqsqlite.dylib 
    sqldrivers/libqsqlite.dylib:
    	/usr/local/opt/qt/plugins/sqldrivers/libqsqlite.dylib (compatibility version 0.0.0, current version 0.0.0)
    	@executable_path/../Frameworks/QtSql.framework/Versions/4/QtSql (compatibility version 4.8.0, current version 4.8.7)
    	@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.7)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    Sherif:PlugIns sherifomran$ 
    
    

  • Lifetime Qt Champion

    IIRC, the id of your plugins should be updated to match where they are currently located.



  • This post is deleted!


  • @SGaist what is IIRC?


  • Lifetime Qt Champion

    IIRC = If I Recall Correctly



  • @SGaist
    do you know how to update the id of the plugin?


  • Lifetime Qt Champion

    install_name_tool -id



  • @SGaist
    I read about install_name_tool but confused between change and id
    could you please give me example?


  • Lifetime Qt Champion

    install_name_tool -id /path/to/lib



  • I made the following to the libraries and frameworks except plugins

    install_name_tool -id @executable_path/../Frameworks/libcrypto.1.0.0.dylib MyApp.app/Contents/Frameworks/libcrypto.1.0.0.dylib 
    

    when i give make codesign it still fails



  • @SherifOmran said:

    codesign] Error 1

    Stupid question, but can you actually codesign something else ?



  • @sandy.martel23
    Very good, it is not studpid question, I tried to sign the library manually and it turned that i then signed each file in the plugin manually and then when i give
    make codesign (it works)

    codesign --sign '3rd Party Mac Developer Application: Sherif Omran (R3JGXHN3B3)' --keychain ~/Library/Keychains/login.keychain ./libcrypto.1.0.0.dylib
    
    

    Thank you..

    Next step, i need to create the package .. Could you please help me with the command?
    when i give
    make package -> it has error



  • But after i codesigned it, the app does not start
    Process: TypingTutor [10399]
    Path: /Users/USER/Desktop/*/TypingTutor.app/Contents/MacOS/TypingTutor
    Identifier: com.PCfone.ArabicTypingTutor
    Version: 1.0.0 (5.1)
    Code Type: X86-64 (Native)
    Parent Process: ??? [1]
    Responsible: TypingTutor [10399]
    User ID: 501

    Date/Time: 2016-02-05 20:39:38.405 +0100
    OS Version: Mac OS X 10.11.3 (15D21)
    Report Version: 11
    Anonymous UUID: 70210516-2C20-592D-A84C-DD5E4F2AE6C1

    Sleep/Wake UUID: D83EB830-6064-42B2-B9B1-2693E5916DDF

    Time Awake Since Boot: 25000 seconds
    Time Since Wake: 1600 seconds

    System Integrity Protection: enabled

    Crashed Thread: 0

    Exception Type: EXC_BAD_ACCESS (Code Signature Invalid)
    Exception Codes: 0x0000000000000032, 0x00000001004f5000
    Exception Note: EXC_CORPSE_NOTIFY

    kernel messages:
    -1 sec CODE SIGNING: cs_invalid_page(0x1004f5000): p=10399[TypingTutor] final status 0x3000200, denying page sending SIGKILL
    -1 sec CODE SIGNING: process 10399[TypingTutor]: rejecting invalid page at address 0x1004f5000 from offset 0x0 in file "/Users/USER/Desktop/*/TypingTutor.app/Contents/Frameworks/QtSql.framework/Versions/4/QtSql" (cs_mtime:1454627177.0 == mtime:1454627177.0) (signed:1 validated:1 tainted:1 wpmapped:0 slid:0)



  • Report: This is a general report for somebody who may search later

    main problem was validation process of appstore. I took 2 approaches
    1- using make codesign (QT)
    2- using xcode

    in the first approach: The problem was make codesign fails, because it turned that i needed to codesign each file on its own. Then i reached a correct make codesign but make product fails to package the app.

    In the second approach: The problem was framework embedding inside the application. App is written with Qt 4.8.7_2 and apple requests a new structure for the framework, in which there is a folder called A inside Versions folder, which does not exist and thus it failed. Note that, there is a folder called 4 inside which there is the framework, if we change this folder name from 4 to A as apple want, the app will crash.
    Solution : Placed the frameworks inside a special folder and from xcode requested to embed the frameworks from this folder. From Terminal, i restructured the framework directory and made internal symbolic links inside the folder (Versions/A -> 4 and Versions/Current->4). In another works, created 2 symbolic links, one called A and the other called Current and both point to A.
    Now Xcode, could validate and codesign, the output file uploaded to Appstore failed with Invalid build. Appstore send me an email stating what is failed. I will check, work on and let you know.

    After correcting all error listed in the automatic email from Appstore that i could understand. There is only 1 error still and i would appreciate your help.

    Final error -

    Invalid Signature - The main app bundle TypingTutor at path TypingTutor.app has following signing error(s): --prepared:/Volumes/data01/app_data/dstr/mz_3951107737348925641dir/mz_287010058513639019dir/com.PCfone.ArabicTypingTutor.pkg/Payload/TypingTutor.app/Contents/Frameworks/libcrypto.1.0.0.dylib --validated:/Volumes/data01/app_data/dstr/mz_3951107737348925641dir/mz_287010058513639019dir/com.PCfone.ArabicTypingTutor.pkg/Payload/TypingTutor.app/Contents/Frameworks/libcrypto.1.0.0.dylib --prepared:/Volumes/data01/app_data/dstr/mz_3951107737348925641dir/mz_287010058513639019dir/com.PCfone.ArabicTypingTutor.pkg/Payload/TypingTutor.app/Contents/Frameworks/libssl.1.0.0.dylib --validated:/Volumes/data01/app_data/dstr/mz_3951107737348925641dir/mz_287010058513639019dir/com.PCfone.ArabicTypingTutor.pkg/Payload/TypingTutor.app/Contents/Frameworks/libssl.1.0.0.dylib --prepared:/Volumes/data01/app_data/dstr/mz_3951107737348925641dir/mz_287010058513639019dir/com.PCfone.ArabicTypingTutor.pkg/Payload/TypingTutor.app/Contents/Frameworks/QtCore.framework/Versions/Current/. /Volumes/data01/app_data/dstr/mz_3951107737348925641dir/mz_287010058513639019dir/com.PCfone.ArabicTypingTutor.pkg/Payload/TypingTutor.app: unsealed contents present in the root directory of an embedded framework In subcomponent: /Volumes/data01/app_data/dstr/mz_3951107737348925641dir/mz_287010058513639019dir/com.PCfone.ArabicTypingTutor.pkg/Payload/TypingTutor.app/Contents/Frameworks/QtCore.framework . Refer to the Code Signing and Application Sandboxing Guide at http://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/AboutCS/AboutCS.html and Technical Note 2206 at https://developer.apple.com/library/mac/technotes/tn2206/_index.html for more information.


  • Lifetime Qt Champion

    Did you check the content of the Info.plist files ?



  • The info plist seems correct ..
    I doubt another thing, i use to create an Archive-> then open it manually and add the plugin folder and another dylib files to the framework and then validate with xcode and send to appstore ..

    I am trying to find a way to include the files within the xcode validation.



  • current problem is : unsealed content in QtCore.framework (root)


  • Lifetime Qt Champion

    Do you have more details coming with that ? e.g. current vs expected ?



  • After long search, i found that this mistakes comes from redundance loop of a symbolic link
    Inside the QtCore.framework/.../Resources, i found i made a symbolic link to the resources folder by mistake ..
    Solution: I removed this symbolic link and resigned the files ..

    For info how to code sign an already signed file is as follows:-

    codesign --force --sign '3rd Party Mac Developer Application: Sherif Omran (R3JGXHN3B3)' --keychain ~/Library/Keychains/login.keychain ./AppFile.app 
    
    

    I ll let you know of the output of the upload as soon as i get the email report



  • I still get the unsealed content error

    Sherif:Applications sherifomran$ codesign --verify --deep --verbose=2 TypingTutor.app/
    --prepared:/Users/sherifomran/Library/Developer/Xcode/Archives/2016-02-07/TypingTutor 07-02-16 00.45.xcarchive/Products/Applications/TypingTutor.app/Contents/Frameworks/libcrypto.1.0.0.dylib
    --validated:/Users/sherifomran/Library/Developer/Xcode/Archives/2016-02-07/TypingTutor 07-02-16 00.45.xcarchive/Products/Applications/TypingTutor.app/Contents/Frameworks/libcrypto.1.0.0.dylib
    --prepared:/Users/sherifomran/Library/Developer/Xcode/Archives/2016-02-07/TypingTutor 07-02-16 00.45.xcarchive/Products/Applications/TypingTutor.app/Contents/Frameworks/libssl.1.0.0.dylib
    --validated:/Users/sherifomran/Library/Developer/Xcode/Archives/2016-02-07/TypingTutor 07-02-16 00.45.xcarchive/Products/Applications/TypingTutor.app/Contents/Frameworks/libssl.1.0.0.dylib
    --prepared:/Users/sherifomran/Library/Developer/Xcode/Archives/2016-02-07/TypingTutor 07-02-16 00.45.xcarchive/Products/Applications/TypingTutor.app/Contents/Frameworks/QtCore.framework/Versions/Current/.
    TypingTutor.app/: unsealed contents present in the root directory of an embedded framework
    In subcomponent: /Users/sherifomran/Library/Developer/Xcode/Archives/2016-02-07/TypingTutor 07-02-16 00.45.xcarchive/Products/Applications/TypingTutor.app/Contents/Frameworks/QtCore.framework



  • I found the following information, but i don't understand it :
    codesign says I have 'unsealed content' somewhere.
    Do not put files or directories into the top directory of an app or framework bundle
    All content must be inside Contents or Versions respectively as described earlier.
    What do they mean?

    My Framework structure is as follows:
    QtGui.framework/
    QtGui -> Versions/Current/QtGui
    Resources -> Versions/Current/Resources/
    Versions



  • update 1:
    I downloaded Qt5.5 and used the macdeployqt from version 5.5.1. It created the framework in a restructured way. However, it is missing the A folder inside the Versions. I created a symbolic link for it pointing to folder 4. I ve xcode project for recompiling and packaging. Xcode tries to sign the A folder.
    codesign --force --sign 016A9E58DED20AC63F1157926166C4082C925F47 --preserve-metadata=identifier,entitlements --timestamp=none /MyApp.app/Contents/Frameworks/QtNetwork.framework/Versions/A

    result----
    bundle format unrecognized, invalid, or unsuitable
    Command /usr/bin/codesign failed with exit code 1.

    When i codesign the folder with
    codesign --sign '3rd Party Mac Developer Application: XXXX XXXX (R3JGXHN3B3)' --keychain ~/Library/Keychains/login.keychain ./Versions/A
    It works and xcode does not produce the same error but then when i submit, AppStore complains at unsigned framework at the root.

    Question: Why doesnot this work? how to debug it?
    codesign --force --sign 016A9E58DED20AC63F1157926166C4082C925F47 --preserve-metadata=identifier,entitlements --timestamp=none /MyApp.app/Contents/Frameworks/QtNetwork.framework/Versions/A


  • Lifetime Qt Champion

    What framework at the root ?



  • Current Issue is the following:
    The framework folder has version folder and inside the version folder there is folder called 4. This 4 must be changed into A for apple to accept it. If we change it to A, the app will crash. This is even not integrated in macdeloyqt 5.5.


  • Lifetime Qt Champion

    In that case change the folder to A and call install_name_tool to fix the paths your application dependencies.



  • Now i could create an archive that is correctly signed with Xcode and if i open the archive and see the content and run the app, it runs. Notice that i ve put both frameworks 4 and A. When i export to generate a package to submit for appstore and submit it. It gets rejects. If i install the application locally, using otool, i see that the app links to frameworks that exist in /usr/..../ folders. But i managed to get the frameworks copied to the package but it still does not run. I get kill 9.

    -- Report --
    To clarify, the app fails to launch as it is linking to frameworks that are missing.
    The frameworks that are missing are:
    '/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib'
    '/usr/local/opt/openssl/lib/libssl.1.0.0.dylib'
    '/usr/local/opt/qt/lib/QtCore.framework'
    '/usr/local/opt/qt/lib/QtGui.framework'
    '/usr/local/opt/qt/lib/QtNetwork.framework'
    '/usr/local/opt/qt/lib/QtSql.framework'

    Best Mac OS X development practices suggest using (in order)

    @executable_path/
    @loader_path/
    @rpath/

    For more information about linking frameworks, please see the following documents:

    • Run-Path Dependent Libraries section of Dynamic Library Programming Topics

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.