From 9c1b790f2e0284b8c37673910e8d53b72bee54ce Mon Sep 17 00:00:00 2001 From: ferris Date: Fri, 20 Jul 2018 12:52:38 +0200 Subject: [PATCH] podspec: Add React dependency Depending on which modules are built and in which order, `React/RCTBridgeModule.h` may or may not be available. Some workarounds for this include disabling parallel builds (https://stackoverflow.com/a/43340802), manually linking against the library instead of using cocoapods (https://github.com/ocetnik/react-native-background-timer/issues/87#issuecomment-401594083), changing the way source files are imported (https://stackoverflow.com/a/41664041), and some others. These workarounds appear to fundamentally disregard the actual problem, which is that these React Native packages all depend on React, and need to be built after the React package has been built. So let's describe this dependency so the build system can solve the issue for us consistently. Another example of this same issue/fix with another React Native package can be found [here](https://github.com/charlires/react-native-segment-analytics/pull/33). Fixes #87. --- react-native-background-timer.podspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/react-native-background-timer.podspec b/react-native-background-timer.podspec index 8ed4b96..15a48d4 100644 --- a/react-native-background-timer.podspec +++ b/react-native-background-timer.podspec @@ -19,4 +19,6 @@ Pod::Spec.new do |s| s.preserve_paths = 'README.md', 'package.json', 'index.js' s.source_files = 'ios/*.{h,m}' + s.dependency 'React' + end