Getting error “No such module” using Xcode, but the framework is there

前端 未结 30 1733
小蘑菇
小蘑菇 2020-11-22 05:02

I\'m currently coding in Swift, and I\'ve got an error:

No such module Social

But I don\'t understand, because the module is in

相关标签:
30条回答
  • 2020-11-22 05:36

    I was getting the same error as i added couple of frameworks using Cocoapods. If we are using Pods in our project, we should use xcodeworkspace instead of xcodeproject. To run the project through xcodebuild, i added -workspace <workspacename> parameter in xcodebuild command and it worked perfectly.

    0 讨论(0)
  • 2020-11-22 05:36

    Sometimes pod deintegrate and then pod install helps me, too.

    0 讨论(0)
  • 2020-11-22 05:39

    What worked for me is this solution to another question. Closing Xcode and reopening the project as workspace.
    Go to your project folder and open .xcodeworkspace file.
    Once you open the workspace (instead of project), Pods should appear as top level project in Project Navigator.

    0 讨论(0)
  • 2020-11-22 05:39

    I had already installed pods. Build worked without any problems when I builded application on my device, but archive didn't work. I just run:

    pod install
    

    no new pods were installed, just .xcodeproj file got regenerated and archive started working

    0 讨论(0)
  • 2020-11-22 05:41

    I was getting same error for

    import Firebase
    

    But then noticed that I was not adding pod to the main target section but only adding to Test and TestUI targets in Podfile.

    With the command

    pod init
    

    for an xcode swift project, the following Podfile is generated

    # Uncomment the next line to define a global platform for your project
    # platform :ios, '9.0'
    
    target 'MyApp' do
      # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
      use_frameworks!
    
      # Pods for MyApp
    
      target 'MyAppTests' do
        inherit! :search_paths
        # Pods for testing
      end
    
      target 'MyAppUITests' do
        inherit! :search_paths
        # Pods for testing
      end
    
    end
    

    So, need to make sure that one adds pods to any appropriate placeholder.

    0 讨论(0)
  • 2020-11-22 05:41

    In General => Linked Frameworks and Libraries, I added my ./Pods/Pods.xcodeproj and it did the trick

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