Planned maintenance has been done but it did not solve the problem. So work will continue on this and a new time for trying updates will be announced asap.

[IOS]Dynamic library with Qt 5.12> (crash)



  • Hi,
    My application uses dynamic library (DotPaySDK and VisaCheckoutSDK).
    With Qt 5.12 or newer I got crash:

    dyld: Library not loaded: @rpath/DotPaySDK.framework/DotPaySDK
    Referenced from: /var/containers/Bundle/Application/.../MyApplication.app/MyApplication
    Reason: image not found
    

    The package after compilation contains Frameworks/DotPaySDK.framework and other libraries.
    I didn't notice any problems using otool -L.

    Main application:

    /System/Library/Frameworks/AssetsLibrary.framework/AssetsLibrary (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
    /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices (compatibility version 1.0.0, current version 947.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
    /System/Library/Frameworks/UIKit.framework/UIKit (compatibility version 1.0.0, current version 61000.0.0)
    /System/Library/Frameworks/OpenGLES.framework/OpenGLES (compatibility version 1.0.0, current version 1.0.0)
    @rpath/DotPaySDK.framework/DotPaySDK (compatibility version 1.0.0, current version 1.1.0)
    @rpath/VisaCheckoutSDK.framework/VisaCheckoutSDK (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore (compatibility version 1.0.0, current version 607.3.9)
    /System/Library/Frameworks/ImageIO.framework/ImageIO (compatibility version 1.0.0, current version 0.0.0)
    /System/Library/Frameworks/CoreMedia.framework/CoreMedia (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/CoreVideo.framework/CoreVideo (compatibility version 1.2.0, current version 1.5.0)
    /System/Library/Frameworks/QuartzCore.framework/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
    /System/Library/Frameworks/AVFoundation.framework/AVFoundation (compatibility version 1.0.0, current version 2.0.0)
    /System/Library/Frameworks/CoreAudio.framework/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/AudioToolbox.framework/AudioToolbox (compatibility version 1.0.0, current version 492.0.0)
    /System/Library/Frameworks/CoreText.framework/CoreText (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics (compatibility version 64.0.0, current version 1265.9.0)
    /System/Library/Frameworks/Security.framework/Security (compatibility version 1.0.0, current version 58286.255.3)
    /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation (compatibility version 150.0.0, current version 1575.17.0)
    /System/Library/Frameworks/Foundation.framework/Foundation (compatibility version 300.0.0, current version 1575.17.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
    

    DotPaySDK:

    @rpath/DotPaySDK.framework/DotPaySDK (compatibility version 1.0.0, current version 1.1.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
    /System/Library/Frameworks/QuartzCore.framework/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
    /System/Library/Frameworks/OpenGLES.framework/OpenGLES (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices (compatibility version 1.0.0, current version 943.1.0)
    /System/Library/Frameworks/Foundation.framework/Foundation (compatibility version 300.0.0, current version 1570.15.0)
    /System/Library/Frameworks/CoreVideo.framework/CoreVideo (compatibility version 1.2.0, current version 1.5.0)
    /System/Library/Frameworks/CoreMedia.framework/CoreMedia (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics (compatibility version 64.0.0, current version 1251.12.0)
    /System/Library/Frameworks/AVFoundation.framework/AVFoundation (compatibility version 1.0.0, current version 2.0.0)
    /System/Library/Frameworks/AudioToolbox.framework/AudioToolbox (compatibility version 1.0.0, current version 492.0.0)
    /System/Library/Frameworks/Accelerate.framework/Accelerate (compatibility version 1.0.0, current version 4.0.0)
    /System/Library/Frameworks/Security.framework/Security (compatibility version 1.0.0, current version 58286.252.1)
    /System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore (compatibility version 1.0.0, current version 607.1.40)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
    /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation (compatibility version 150.0.0, current version 1570.15.0)
    /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration (compatibility version 1.0.0, current version 963.250.1)
    /System/Library/Frameworks/UIKit.framework/UIKit (compatibility version 1.0.0, current version 61000.0.0)
    /System/Library/Frameworks/WebKit.framework/WebKit (compatibility version 1.0.0, current version 607.1.40)
    @rpath/VisaCheckoutSDK.framework/VisaCheckoutSDK (compatibility version 1.0.0, current version 1.0.0)
    

    And .pro file looks:

    QT += quick svg concurrent
    ios {
        QTPLUGIN += qavfcamera
    }
    
    CONFIG += c++14
    CONFIG -= bitcode
    
    # The following define makes your compiler emit warnings if you use
    # any feature of Qt which as been marked deprecated (the exact warnings
    # depend on your compiler). Please consult the documentation of the
    # deprecated API in order to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if you use deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
       < ... >
    
    HEADERS += \
        < ... >
    
    ios
    {
        OBJECTIVE_SOURCES += \
       < ... >
    
        HEADERS += \
       < ... >
    }
    
    RESOURCES += qml.qrc \
        images.qrc
    
    ios {
        QMAKE_ASSET_CATALOGS = $$PWD/ios/resources/Assets.xcassets
        QMAKE_INFO_PLIST = $$PWD/ios/Info.plist
    }
    
    # Libraries
    ios {
        LIBS += -F$$PWD/ios/libs -framework DotPaySDK -framework VisaCheckoutSDK -framework JavaScriptCore
        INCLUDEPATH += $$PWD/ios/libs/
        DEPENDPATH += $$PWD/ios/libs/
    
        FRAMEWORKS_DATA.files = $$files($$PWD/ios/libs/*.framework)
        FRAMEWORKS_DATA.path = /Frameworks
        QMAKE_BUNDLE_DATA += FRAMEWORKS_DATA
    
        QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Frameworks/
    }
    
    <...>
    #etc.
    

    Any idea how to fix it?


  • Lifetime Qt Champion

    Hi,

    It seems that you are going to have to use install_name_tool to fix the path issues.


Log in to reply