Xcode10 - dyld: Library not loaded for pod installed in framework












2















I have a project with target frameworks.




  • MainAppTarget

  • FrameworkA


FrameworkA is the only one to use a certain pod, hence in my pod file I have something like



target 'MainAppTarget' do
...
end

target 'FrameworkA' do
pod 'PodA'
end


the build succeeds with no problem, but when I run the app on a simulator the app crashes immediately with the following error message:



dyld: Library not loaded: @rpath/PodA.framework/PodA
Referenced from: .../Build/Products/Development-iphonesimulator/FrameworkA.framework/FrameworkA
Reason: image not found


I tried all the usual suspects (delete derived data, clean, pod deintegrate...) nothing worked so far.



Any idea why this would happen, and how I can make it work without having to install all the pods necessarily on both targets?



The app is in Swift 4.2.










share|improve this question





























    2















    I have a project with target frameworks.




    • MainAppTarget

    • FrameworkA


    FrameworkA is the only one to use a certain pod, hence in my pod file I have something like



    target 'MainAppTarget' do
    ...
    end

    target 'FrameworkA' do
    pod 'PodA'
    end


    the build succeeds with no problem, but when I run the app on a simulator the app crashes immediately with the following error message:



    dyld: Library not loaded: @rpath/PodA.framework/PodA
    Referenced from: .../Build/Products/Development-iphonesimulator/FrameworkA.framework/FrameworkA
    Reason: image not found


    I tried all the usual suspects (delete derived data, clean, pod deintegrate...) nothing worked so far.



    Any idea why this would happen, and how I can make it work without having to install all the pods necessarily on both targets?



    The app is in Swift 4.2.










    share|improve this question



























      2












      2








      2








      I have a project with target frameworks.




      • MainAppTarget

      • FrameworkA


      FrameworkA is the only one to use a certain pod, hence in my pod file I have something like



      target 'MainAppTarget' do
      ...
      end

      target 'FrameworkA' do
      pod 'PodA'
      end


      the build succeeds with no problem, but when I run the app on a simulator the app crashes immediately with the following error message:



      dyld: Library not loaded: @rpath/PodA.framework/PodA
      Referenced from: .../Build/Products/Development-iphonesimulator/FrameworkA.framework/FrameworkA
      Reason: image not found


      I tried all the usual suspects (delete derived data, clean, pod deintegrate...) nothing worked so far.



      Any idea why this would happen, and how I can make it work without having to install all the pods necessarily on both targets?



      The app is in Swift 4.2.










      share|improve this question
















      I have a project with target frameworks.




      • MainAppTarget

      • FrameworkA


      FrameworkA is the only one to use a certain pod, hence in my pod file I have something like



      target 'MainAppTarget' do
      ...
      end

      target 'FrameworkA' do
      pod 'PodA'
      end


      the build succeeds with no problem, but when I run the app on a simulator the app crashes immediately with the following error message:



      dyld: Library not loaded: @rpath/PodA.framework/PodA
      Referenced from: .../Build/Products/Development-iphonesimulator/FrameworkA.framework/FrameworkA
      Reason: image not found


      I tried all the usual suspects (delete derived data, clean, pod deintegrate...) nothing worked so far.



      Any idea why this would happen, and how I can make it work without having to install all the pods necessarily on both targets?



      The app is in Swift 4.2.







      swift frameworks cocoapods dyld xcode10.1






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 25 at 4:00









      Cœur

      19.1k9114155




      19.1k9114155










      asked Nov 22 '18 at 20:50









      Giuseppe LanzaGiuseppe Lanza

      1,969926




      1,969926
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I too was facing the same problem. All you need to do is set the third party frameworks you are using for e.g:- PodA as Optional instead of Required under Link binary with Libraries in build Phases section. That's all. try it again and it will run as expected.



          Note:- You need to add the PodA in the app in which you are using your framework.
          There is no other way except create a static framework consisting your PodA and use this newly created static framework inside your dynamic framework.






          share|improve this answer
























          • If I add the PodA to the main target there is no need to set the pod as optional. To get PodA in the main target is exactly what I want to avoid.

            – Giuseppe Lanza
            Nov 26 '18 at 9:13











          • Then you need to follow the steps mentioned in "Note"

            – sanyam jain
            Nov 26 '18 at 11:08











          • Again. This is exactly what I want to avoid.

            – Giuseppe Lanza
            Nov 26 '18 at 11:49











          • Then it is not possible. There is no other way. If you found something do let me know.

            – sanyam jain
            Nov 27 '18 at 6:37











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53437837%2fxcode10-dyld-library-not-loaded-for-pod-installed-in-framework%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          I too was facing the same problem. All you need to do is set the third party frameworks you are using for e.g:- PodA as Optional instead of Required under Link binary with Libraries in build Phases section. That's all. try it again and it will run as expected.



          Note:- You need to add the PodA in the app in which you are using your framework.
          There is no other way except create a static framework consisting your PodA and use this newly created static framework inside your dynamic framework.






          share|improve this answer
























          • If I add the PodA to the main target there is no need to set the pod as optional. To get PodA in the main target is exactly what I want to avoid.

            – Giuseppe Lanza
            Nov 26 '18 at 9:13











          • Then you need to follow the steps mentioned in "Note"

            – sanyam jain
            Nov 26 '18 at 11:08











          • Again. This is exactly what I want to avoid.

            – Giuseppe Lanza
            Nov 26 '18 at 11:49











          • Then it is not possible. There is no other way. If you found something do let me know.

            – sanyam jain
            Nov 27 '18 at 6:37
















          0














          I too was facing the same problem. All you need to do is set the third party frameworks you are using for e.g:- PodA as Optional instead of Required under Link binary with Libraries in build Phases section. That's all. try it again and it will run as expected.



          Note:- You need to add the PodA in the app in which you are using your framework.
          There is no other way except create a static framework consisting your PodA and use this newly created static framework inside your dynamic framework.






          share|improve this answer
























          • If I add the PodA to the main target there is no need to set the pod as optional. To get PodA in the main target is exactly what I want to avoid.

            – Giuseppe Lanza
            Nov 26 '18 at 9:13











          • Then you need to follow the steps mentioned in "Note"

            – sanyam jain
            Nov 26 '18 at 11:08











          • Again. This is exactly what I want to avoid.

            – Giuseppe Lanza
            Nov 26 '18 at 11:49











          • Then it is not possible. There is no other way. If you found something do let me know.

            – sanyam jain
            Nov 27 '18 at 6:37














          0












          0








          0







          I too was facing the same problem. All you need to do is set the third party frameworks you are using for e.g:- PodA as Optional instead of Required under Link binary with Libraries in build Phases section. That's all. try it again and it will run as expected.



          Note:- You need to add the PodA in the app in which you are using your framework.
          There is no other way except create a static framework consisting your PodA and use this newly created static framework inside your dynamic framework.






          share|improve this answer













          I too was facing the same problem. All you need to do is set the third party frameworks you are using for e.g:- PodA as Optional instead of Required under Link binary with Libraries in build Phases section. That's all. try it again and it will run as expected.



          Note:- You need to add the PodA in the app in which you are using your framework.
          There is no other way except create a static framework consisting your PodA and use this newly created static framework inside your dynamic framework.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 26 '18 at 6:16









          sanyam jainsanyam jain

          216




          216













          • If I add the PodA to the main target there is no need to set the pod as optional. To get PodA in the main target is exactly what I want to avoid.

            – Giuseppe Lanza
            Nov 26 '18 at 9:13











          • Then you need to follow the steps mentioned in "Note"

            – sanyam jain
            Nov 26 '18 at 11:08











          • Again. This is exactly what I want to avoid.

            – Giuseppe Lanza
            Nov 26 '18 at 11:49











          • Then it is not possible. There is no other way. If you found something do let me know.

            – sanyam jain
            Nov 27 '18 at 6:37



















          • If I add the PodA to the main target there is no need to set the pod as optional. To get PodA in the main target is exactly what I want to avoid.

            – Giuseppe Lanza
            Nov 26 '18 at 9:13











          • Then you need to follow the steps mentioned in "Note"

            – sanyam jain
            Nov 26 '18 at 11:08











          • Again. This is exactly what I want to avoid.

            – Giuseppe Lanza
            Nov 26 '18 at 11:49











          • Then it is not possible. There is no other way. If you found something do let me know.

            – sanyam jain
            Nov 27 '18 at 6:37

















          If I add the PodA to the main target there is no need to set the pod as optional. To get PodA in the main target is exactly what I want to avoid.

          – Giuseppe Lanza
          Nov 26 '18 at 9:13





          If I add the PodA to the main target there is no need to set the pod as optional. To get PodA in the main target is exactly what I want to avoid.

          – Giuseppe Lanza
          Nov 26 '18 at 9:13













          Then you need to follow the steps mentioned in "Note"

          – sanyam jain
          Nov 26 '18 at 11:08





          Then you need to follow the steps mentioned in "Note"

          – sanyam jain
          Nov 26 '18 at 11:08













          Again. This is exactly what I want to avoid.

          – Giuseppe Lanza
          Nov 26 '18 at 11:49





          Again. This is exactly what I want to avoid.

          – Giuseppe Lanza
          Nov 26 '18 at 11:49













          Then it is not possible. There is no other way. If you found something do let me know.

          – sanyam jain
          Nov 27 '18 at 6:37





          Then it is not possible. There is no other way. If you found something do let me know.

          – sanyam jain
          Nov 27 '18 at 6:37




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53437837%2fxcode10-dyld-library-not-loaded-for-pod-installed-in-framework%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Xamarin.form Move up view when keyboard appear

          Post-Redirect-Get with Spring WebFlux and Thymeleaf

          Anylogic : not able to use stopDelay()