Member-only story

Speed up iOS builds by turning off Flipper on CI (complete React Native guide)

Davyd NRB
2 min readDec 25, 2022

The simple way to speed up pod install it's turn off Flipper for CI builds.

iOS builds on GitHub Actions

1) For old React Native versions 0.68.x and lower edit your ios/Podfile:

# ./ios/Podfile
if !ENV['CI']
use_flipper!()
end

2) For React Native 0.69.x...0.70.x:

# ./ios/Podfile
use_react_native!(
:flipper_configuration => ENV['CI'] ?
FlipperConfiguration.disabled :
FlipperConfiguration.enabled,
# ...
# Note: you can pass extra params
# FlipperConfiguration.enabled(['Debug', 'Staging.Debug'], { 'Flipper': '0.174.0' })
)

3) If you are using modern React Native 0.71.x and higher you can just add one env variable NO_FLIPPER=1 that prevent installing

export NO_FLIPPER=1
pod install --project-directory=ios
# or inline
NO_FLIPPER=1 pod install --project-directory=ios

Troubleshooting

If your iOS build will fail with next error:

node_modules/react-native-flipper/ios/FlipperReactNativeJavaScriptPlugin.h:9:9: 'FlipperKit/FlipperConnection.h' file not found

#import <FlipperKit/FlipperConnection.h>

This occurs because the FlipperKit pod is disabled on CI but the react-native-flipper package requires it to be installed.

Solution will be easy, just exclude that module on CI too, you need to edit/add react-native.config.js in the root folder of your project:

// react-native.config.js
module.exports = {
dependencies: {
...(process.env.CI // or `process.env.NO_FLIPPER` for RN@0.71.x and above
? { 'react-native-flipper': { platforms: { ios: null } } }
: {}),
},
project: {
ios: {},
android: {},
},
};

Davyd NRB
Davyd NRB

Written by Davyd NRB

React Native guru 🧘\ DevOps adjutant \ Linux lover ❤️

Responses (1)

Write a response

You gave a lot of knowledge free... Congratulations!

Recommended from Medium

Lists

See more recommendations