Tim J
Tim J

Reputation: 1271

Custom Cocoapod always returns "No such module XXX"

I followed the guide found here

This is my .podspec file

Pod::Spec.new do |s|
  s.name         = "iOSUtils"
  s.version      = "0.0.1"
  s.summary      = "A really short description of MyFramework."
  s.description  = <<-DESC
  A much much much longer description of MyFramework.
                   DESC
  s.homepage     = "https://github.com/xxxxxxx/ios-utils"
  s.license      = "MIT"
  s.author       = { "xxxxxxx" => "[email protected]" }
  s.source       = { :path => '.' }
  # s.source       = { :git => "https://github/samwize/MyFramework", :tag => "#{s.version}" }
  s.source_files  = "Source/**/*.swift"
end

My solution is laid out as enter image description here

And for testing purposes I created a simple service

public class TestService {
    static public let shared = TestService()
    private init() { }

    public func foo() {
        print("bar")
    }
}

The Podfile of my project that will use this new framework looks like pod 'iOSUtils', :path => '../iOSUtils' and running install returns success messages.

When I then try and import my module however, I get the no such module error and cannot build.

Looking at my project also, I cannot see the source included under development pods

enter image description here

Upvotes: 0

Views: 957

Answers (1)

nodediggity
nodediggity

Reputation: 2488

Try adding your package name into the s.source_files of your iOSUtils.podspec file.

  s.source_files  = "iOSUtils/Source/**/*.swift"

Upvotes: 1

Related Questions