-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flipper shouldn't be included in Release builds #28
Comments
I thought that we had excluded this from release builds, but the only thing I can find is an open PR for Andorid. cc @passy @alloy facebook/react-native#28257 |
@javiercr Yup, looks like it, good catch. Mind sending a PR after verifying those changes work for you? |
Definitely shouldn't be included in release builds. We exclude it in Android release builds, too. |
@passy do you mean it's already excluded for Android in the templates from RN @alloy I'll give it a try with a fresh project. I tried once yesterday but Flipper was still being included, but I suspect is because we had |
@javiercr Already excluded in 0.62. :) |
yes for android it's excluded as it's only specified as a
|
@alloy I've created a new project, then added all transitive dependencies related to Flipper that I found in def add_flipper_pods!
version = '~> 0.33.1'
pod 'FlipperKit', version, :configuration => 'Debug'
pod 'FlipperKit/FlipperKitLayoutPlugin', version, :configuration => 'Debug'
pod 'FlipperKit/SKIOSNetworkPlugin', version, :configuration => 'Debug'
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', version, :configuration => 'Debug'
pod 'FlipperKit/FlipperKitReactPlugin', version, :configuration => 'Debug'
# Exclude transitive dependencies from Release builds
pod 'Flipper', version, :configuration => 'Debug'
pod 'Flipper-DoubleConversion', '1.1.7', :configuration => 'Debug'
pod 'Flipper-Folly', '~> 2.1', :configuration => 'Debug'
pod 'Flipper-Glog', '0.3.6', :configuration => 'Debug'
pod 'Flipper-PeerTalk', '~> 0.0.4', :configuration => 'Debug'
pod 'Flipper-RSocket', '~> 1.0', :configuration => 'Debug'
pod 'FlipperKit/Core', version, :configuration => 'Debug'
pod 'FlipperKit/CppBridge', version, :configuration => 'Debug'
pod 'FlipperKit/FBCxxFollyDynamicConvert', version, :configuration => 'Debug'
pod 'FlipperKit/FBDefines', version, :configuration => 'Debug'
pod 'FlipperKit/FKPortForwarding', version, :configuration => 'Debug'
pod 'FlipperKit/FlipperKitHighlightOverlay', version, :configuration => 'Debug'
pod 'FlipperKit/FlipperKitLayoutTextSearchable', version, :configuration => 'Debug'
pod 'FlipperKit/FlipperKitNetworkPlugin', version, :configuration => 'Debug'
end Then did However it seems Xcode is still building stuff the Flipper libraries: I'm not an expert on cocoapods so I am not sure if the fact that these libraries are being build means that they're also included in the resulting Release build. Is that normal? |
Answering myself from CocoaPods/CocoaPods#9658 (comment)
Until cocoapods supports excluding transitive dependencies for a specific build configuration, from the React Native side I think the best we can do is try to list all Flipper dependencies in the Podfile, they will be still build for Release mode, but shouldn't be linked in the final IPA. |
Yup, that’s the important bit 👍 Note that you can always verify this yourself by checking the built app binary with |
To readers needing immediate support, make the following changes to your |
#28504) Summary: The `:configuration` option from `pod` only affects the specified pod and not its dependencies [1]. Therefore in order to avoid all transitive dependencies being linked in the resulting Release IPA we need to list them in the `Podfile`. Note that this will still build Flipper's pods when doing a Release, but it won't link it in the resulting IPA. [1] https://guides.cocoapods.org/syntax/podfile.html#pod Fixes react-native-community/upgrade-support#28 Related CocoaPods/CocoaPods#9658 * [iOS] [Fixed] - Exclude Flipper from iOS Release builds Pull Request resolved: #28504 Test Plan: Create a new React Native 0.62 project, run `pod install`, then diff: ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.debug.xcconfig` ``` and ``` ProjectName/ios/Pods/Target Support Files/Pods-ProjectName/Pods-ProjectName.relaese.xcconfig ``` ![image](https://user-images.githubusercontent.com/855995/78337679-a3fa0280-7591-11ea-8142-6f82cbc6be58.png) Reviewed By: passy Differential Revision: D20894406 Pulled By: priteshrnandgaonkar fbshipit-source-id: 680780f0f5a85fd8423b85a271a499bd12f06d00
I did what you suggested and rebuild everything from scratch. However, I still seeing the flipper related libraries were included as part of the build. As a workaround, i just commented out all flipper pod and rebuild.......... This is kind of annoying, and hopefully Cocapod would address it soon..... |
@guanhuay Alas there is no way for CocoaPods to have control over this, as Xcode does not offer that ability. |
If by these you mean you see Flipper libraries being build in the console logs, I'd say that's normal. See the comments in my merged PR:
I hope we could get rid of Flipper during the build of a Release, as I have the feeling that iOS build have become much slower since the introduction of Flipper, but apparently that's not possible at the moment :/ |
Hi Javier, Thanks for your reply, based on your comment. Even though flipper was built as part of the release, it just slow down the overall build time, but no flipper file would go into release artifact, right? |
As far as I know that's correct. |
Aye, it is correct. You can check the LD flags in the xcconfig CocoaPods generates for your target/configuration to see the flipper libs are only included in the debug variant. |
I face the similar kind of problem in release mode and then I delete the release folder from
and Got Success |
Environment
Upgrading version
From
0.61.3
to0.62.0
Description
After upgrading to 0.62, when we created our first iOS Release build, we noticed some warnings related to Flipper's pods such as:
This made us wonder why is Flipper included in a build using the Release mode configuration. We've seen that the new Podfile template only includes the
FlipperKit
pods for theDebug
build configuration:However the Cocoapods' docs notes that:
The pod
Flipper-Folly
is a dependency ofFlipper
, andFlipper
seems to be dependency ofFlipperKit/Core
andFlipperKit/CppBridge
.Is this why it's being built and linked on
Release
build? Shouldadd_flipper_pods!
specify theFlipper
andFlipper-Folly
pods so that they get excluded fromRelease
builds?The text was updated successfully, but these errors were encountered: