Skip to content

GTMSessionFetcher cannot be integrated as static libraries with CocoaPods because it does not define a module (DEFINES_MODULE) #384

Closed
@jmagman

Description

@jmagman

Steps to reproduce

  1. Install CocoaPods.
  2. In Xcode, make new iOS app project.
  3. cd into the directory and pod init to initialize CocoaPods.
  4. In the generated Podfile comment out use_frameworks! to embed as static libs. Add a pod that depends on GTMSessionFetcher, for example, GTMAppAuth:
  # Comment the next line if you don't want to use dynamic frameworks
  # use_frameworks!
  pod 'GTMAppAuth', '4.1.1'
  1. Run pod install

Result
pod install fails:

$ pod install
Analyzing dependencies
Downloading dependencies
Installing AppAuth (1.7.3)
Installing GTMAppAuth (4.1.1)
Installing GTMSessionFetcher (3.3.2)
[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `GTMAppAuth` depends upon `GTMSessionFetcher` and `AppAuth`, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

GTMSessionFetcher is not setting up a module, and doesn't have DEFINES_MODULE for that to be done automatically.

This can be fixed by adding DEFINES_MODULE to GTMSessionFetcher.podspec. See CocoaPods documentation about modular headers.

  s.xcconfig = {
     'DEFINES_MODULE' => 'YES',
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions