Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to add a ios-framework to qt-project ?
QtWS25 Last Chance

How to add a ios-framework to qt-project ?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
7 Posts 4 Posters 1.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.
  • K Offline
    K Offline
    Kegin
    wrote on 18 Jun 2019, 02:06 last edited by Kegin
    #1

    I want to add a ios_framework to my qt-project,
    It is located the at /Volumes/Data/SvnData/Codes/Libraries/IOS/MyFramework.framework
    I already set the .pro
    but when I run the app on the IPhone,
    I get a issue , the app was crashed.

    dyld: Library not loaded: @rpath/MyFramework.framework/MyFramework
    Referenced from: /var/containers/Bundle/Application/3BB2B369-0047-4952-B0BE-47EF91019DE9/test.app/test
    Reason: image not found

    This is my setting of .pro

    ios:
    {
    QMAKE_LFLAGS += -F/Volumes/Data/SvnData/Codes/Libraries/IOS/MyFramework.framework
    LIBS += -F/Volumes/Data/SvnData/Codes/Libraries/IOS
    LIBS += -framework MyFramework
    }

    What's the wrong? How can i do? Please help me. thanks.

    J 1 Reply Last reply 18 Jun 2019, 04:42
    0
    • K Kegin
      18 Jun 2019, 02:06

      I want to add a ios_framework to my qt-project,
      It is located the at /Volumes/Data/SvnData/Codes/Libraries/IOS/MyFramework.framework
      I already set the .pro
      but when I run the app on the IPhone,
      I get a issue , the app was crashed.

      dyld: Library not loaded: @rpath/MyFramework.framework/MyFramework
      Referenced from: /var/containers/Bundle/Application/3BB2B369-0047-4952-B0BE-47EF91019DE9/test.app/test
      Reason: image not found

      This is my setting of .pro

      ios:
      {
      QMAKE_LFLAGS += -F/Volumes/Data/SvnData/Codes/Libraries/IOS/MyFramework.framework
      LIBS += -F/Volumes/Data/SvnData/Codes/Libraries/IOS
      LIBS += -framework MyFramework
      }

      What's the wrong? How can i do? Please help me. thanks.

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 18 Jun 2019, 04:42 last edited by
      #2

      @Kegin From your description it is not clear what you already did.
      Did you install XCode?
      Did you install Qt for iOS?
      Do you have an iOS Kit in QtCreator?
      Did you successfully build your app?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • K Offline
        K Offline
        Kegin
        wrote on 18 Jun 2019, 05:48 last edited by Kegin
        #3

        thank your reply.

        yes,
        I have installed Xcode,
        I think the environment is correct.

        before I don't add the iOS-framework,
        I have successfully run first app on iPhone,

        but when I want add the ios-framework,
        modify my project (.pro),
        add some settings
        it crashed, and could not run...

        Error saying it can't load the ios-framework

        when I want use api of third-party iOS-framework
        how can I change the settings of .pro?

        J 1 Reply Last reply 18 Jun 2019, 05:50
        0
        • K Kegin
          18 Jun 2019, 05:48

          thank your reply.

          yes,
          I have installed Xcode,
          I think the environment is correct.

          before I don't add the iOS-framework,
          I have successfully run first app on iPhone,

          but when I want add the ios-framework,
          modify my project (.pro),
          add some settings
          it crashed, and could not run...

          Error saying it can't load the ios-framework

          when I want use api of third-party iOS-framework
          how can I change the settings of .pro?

          J Offline
          J Offline
          J.Hilk
          Moderators
          wrote on 18 Jun 2019, 05:50 last edited by
          #4

          @Kegin
          a vague answer to a vague question

          LIBS += -framework frameworkName


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          K 1 Reply Last reply 18 Jun 2019, 06:16
          1
          • J J.Hilk
            18 Jun 2019, 05:50

            @Kegin
            a vague answer to a vague question

            LIBS += -framework frameworkName

            K Offline
            K Offline
            Kegin
            wrote on 18 Jun 2019, 06:16 last edited by Kegin
            #5

            @J.Hilk

            Sorry, may I did not clearly explain my problem.

            So.. if i want to link a third-party ios-framework,
            Just add the “LIBs += ...“ ?

            But i already add the lines to .pro

            LIBS += -F/Volumes/Data/SvnData/Codes/Libraries/IOS
            LIBS += -framework MyFramework

            Before i don’t modify .pro for use ios-framework
            I build the app is successfully
            run the app also is successfully.

            I tried..
            I include the header-path of ios-framework in my codes.
            It can found, and it build successlly,
            But when i run it, it crash at running time

            The error is

            dyld: Library not loaded: @rpath/MyFramework.framework/MyFramework
            Referenced from: /var/containers/Bundle/Application/3BB2B369-0047-4952-B0BE-47EF91019DE9/test.app/test
            Reason: image not found

            1 Reply Last reply
            0
            • K Offline
              K Offline
              Kegin
              wrote on 18 Jun 2019, 08:26 last edited by Kegin
              #6

              I am trying to link GoogleMobileAds.framework,
              It is working fine

              But I link MyFramework.framework
              It runs and crashes

              I found the difference between two frameworks.
              MyFramework.framework has a file, it is exec

              MyFramework.framework is a dynamically linked shared library.

              0_1560844667759_Screen Shot 2019-06-18 at 3.57.35 PM.png

              0_1560845598968_Screen Shot 2019-06-18 at 3.56.57 PM.png

              According to this article
              https://stackoverflow.com/questions/24333981/ios-app-with-framework-crashed-on-device-dyld-library-not-loaded-xcode-6-beta/28469804

              Maybe I need to add MyFramework.framework to "Embedded Binaries"? How to set this in QT-Project?

              D 1 Reply Last reply 5 Mar 2020, 22:52
              0
              • K Kegin
                18 Jun 2019, 08:26

                I am trying to link GoogleMobileAds.framework,
                It is working fine

                But I link MyFramework.framework
                It runs and crashes

                I found the difference between two frameworks.
                MyFramework.framework has a file, it is exec

                MyFramework.framework is a dynamically linked shared library.

                0_1560844667759_Screen Shot 2019-06-18 at 3.57.35 PM.png

                0_1560845598968_Screen Shot 2019-06-18 at 3.56.57 PM.png

                According to this article
                https://stackoverflow.com/questions/24333981/ios-app-with-framework-crashed-on-device-dyld-library-not-loaded-xcode-6-beta/28469804

                Maybe I need to add MyFramework.framework to "Embedded Binaries"? How to set this in QT-Project?

                D Offline
                D Offline
                David K. Hess
                wrote on 5 Mar 2020, 22:52 last edited by David K. Hess 3 May 2020, 22:54
                #7

                @Kegin (and anybody else who stumbles on this), see this comment and mine following it:

                https://bugreports.qt.io/browse/QTBUG-51951?focusedCommentId=457045&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-457045

                Summarized, you need to spec the framework in QMAKE_BUNDLE_DATA and then add a linker switch to make sure the executable can find it at run time.

                1 Reply Last reply
                2

                • Login

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