google / promises

Promises is a modern framework that provides a synchronization construct for Swift and Objective-C.
Apache License 2.0
3.8k stars 295 forks source link

PromisesSwift cannot be integrated as a static library #168

Open thatjiaozi opened 3 years ago

thatjiaozi commented 3 years ago

When creating an app that depends on pod 'PromisesSwift' and that uses static libraries,I get the following error:

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `PromisesSwift` depends upon `PromisesObjC`, which does 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.

An example podfile for this would be the following:

source 'https://github.com/CocoaPods/Specs.git'

target 'CocoaPodsDebug' do

  # Comment the next line if you don't want to use dynamic frameworks

  #use_frameworks!

  pod 'PromisesObjC'
  pod 'PromisesSwift'

end

note that use_frameworks! is commented out, also if we add :modular_headers => true to pod 'PromisesObjC'` the error goes away.

The question is: are there any plans to make this work by default?

sregg commented 2 years ago

@JJLionHeart did you find a way around that? I'm also running into this issue when installing RecaptchaEnterprise.

sregg commented 2 years ago

I fixed it by adding use_modular_headers! in my Podfile and adding :modular_headers => false to a bunch of pods

faimin commented 2 years ago

181

imekinox commented 2 years ago

Easier fix:

pod 'PromisesObjC', :modular_headers => true