ld: framework not found Stripe for architecture x86_64

前端 未结 4 2109
再見小時候
再見小時候 2020-12-10 11:45

I have an iOS component which relies on the Stripe iOS SDK, Project A. I included the Stripe SDK in Project A in Xcode and it compiles fine.

However, I\'m building

相关标签:
4条回答
  • 2020-12-10 12:17

    Noticed this problem while switching some dependencies from pods to carthage. Similar to Honey's answer, I was able to get around this error modifying the podfile.

    Turns out all I had to add was the test target. Then run 'pod install', and it will link your test target to your the frameworks generated by your pods.

    target 'Project' do
      use_frameworks!
    
      //pods here normally
    
      target 'ProjectTests' do
       //nothing in here
      end
    end
    
    0 讨论(0)
  • 2020-12-10 12:18

    I had to do two things to get this working:

    1. Add "$(SRCROOT)/../.." (since Project B lives two folders deep inside Project A) to "Framework Search Paths" under Build Settings -> "Search Paths" for the Project B target.

    2. Add the Stripe SDK to Project B's frameworks as well. This second step in particular surprised me because Project B does not rely directly upon Stripe.

    0 讨论(0)
  • 2020-12-10 12:25

    I was seeing this same issue with another framework while running my test target. I had to add the framework to my test target (not only my normal target) under Build Phases > Link Binary With Libraries section.

    Carthage has more info about the issue I saw: https://github.com/carthage/carthage#adding-frameworks-to-unit-tests-or-a-framework

    0 讨论(0)
  • 2020-12-10 12:32

    Did you run into this issue when you ran your test cases?

    So this is how my podfile looks like:

    def shared_pods
        pod ‘GoogleMaps', '~> 1.13.0'
        pod ‘SwiftyJSON', '~> 2.3.2'
        pod ‘Alamofire', '~> 3.2.1'
        pod ‘MGSwipeTableCell’
    end
    
    target 'projectName' do
       shared_pods
    end
    

    So then I added this to podfile:

    target ‘ProjectTests’ do
        pod ‘Nimble’, ‘~> 4.0.0’
        pod ’Quick’
    end
    

    What I also needed to do was:

    target ‘ProjectTests’ do
        shared_pods // I needed to add this line as well. Since this line included the needed 'MGSwipeTableCell' framework 
        pod ‘Nimble’, ‘~> 4.0.0’
        pod ’Quick’
    end
    

    So a possible reason would be that in your podfile you didn't add them correctly, just be sure that the framework is added into the necessary targets.

    0 讨论(0)
提交回复
热议问题