react-native-purchases: Cannot install pod dependencies for react-native-purchases@4.0.0
Hi!
Today I’m trying to upgrade react-native-purchases to version 4.0.0 because I need to use offer codes.
What I did:
- Updated version in package.json:
"react-native-purchases": "^4.0.0",and in terminal executednpm install. - Went to
iosfolder and executedpod install. - Getting this error:
[!] The following Swift pods cannot yet be integrated as static libraries:
The Swift pod `RNPurchases` depends upon `React-Core`, 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.
What else I tried:
- set deployment target to
iOS 14.0 - removing
package-lock.jsonandnode_modulesfolder before installing dependencies. - removing
Podfile.lockfile andios/Podsfolder before installing dependencies.
- Environment
- Platform:
iOS - SDK version:
- OS version:
macOS 11.1 - XCode/Android Studio version:
12.3 - react-native version
0.61.5
- Platform:
Just to mention, currently we’re using react-native-purchases@3.4.3 with no troubles, thanks in advance 😃
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 18 (5 by maintainers)
code :
pod 'React-Core', :path => '../node_modules/react-native/', :modular_headers => trueAdd this line to your Podfile in your ios folder.
Hi everyone!! Thanks for reporting.
I believe this is related to #191 (the changes were integrated into a different PR, but that’s the gist of it).
The changes were motivated by https://github.com/facebook/react-native/issues/29633#issuecomment-694187116 And the important part of it is
Could you try adding the following line to your Podfile?
If that raises issues with other dependencies, then maybe try replacing
with
(i.e.: adding the
modular_headersbit)Let me know if that works!
I am facing with the same issue.
Thank You, This Solution saved my day.Worked perfectly
@aboedo Yes, works, thank you!
Same issue