Skip to content
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

RN 0.62.2 iOS builds are taking twice as long #226

Closed
ptspencer opened this issue May 7, 2020 · 5 comments
Closed

RN 0.62.2 iOS builds are taking twice as long #226

ptspencer opened this issue May 7, 2020 · 5 comments

Comments

@ptspencer
Copy link

Introduction

I work on two different mobile applications and went about upgrading to the latest version of react-native. After doing so I saw my iOS build times increase drastically.

The Core of It

We use Bitrise to automate our build flow and builds that used to take about 25 minutes are now taking between 45 and 60 minutes.
I've also noticed that even my local debug builds have taken longer to build.
I assumed that this was because of the introduction of Flipper, but removing the Flipper pods only removed about 10 minutes from the total build?

Discussion points

Is any one else experiencing longer iOS Builds?
Any ideas as to what might be causing this, or suggestions for optimization?

@TheSavior
Copy link

This repo is for long form discussions about the future of React Native. As this seems like a specific bug, opening this issue in the React Native repo is probably the right choice. If this doesn't repro in a new project but only when upgrading your existing project, then consider opening an issue in the upgrade-support repo instead.

@brodybits
Copy link

brodybits commented May 7, 2020

FYI I do not see the longer build on iOS after removing Flipper. Sorry if this is off-topic but here is how I get rid of Flipper in case it may help anyone else:

  • comment out (or remove) the add_flipper_pods! line in ios/Podfile
  • (cd ios && pod install)
  • disable or remove the 2 places in AppDelegate.m that are using Flipper (or use AppDelegate.m from React Native 0.60 or 0.61 template)

Thanks to facebook/flipper#976 for helping me figure this out.

Yes I would also favor discussion in https://github.com/facebook/react-native/issues.

@martinezguillaume
Copy link

@brodybits Hey ! If I'm doing it, I get this error when trying to build in Release for generic iOS device:

module map file '/Users/vagrant/Library/Developer/Xcode/DerivedData/Milinus-dxumshxeoaovlmclppxhdmkdqvre/Build/Intermediates.noindex/ArchiveIntermediates/Milinus/BuildProductsPath/Release-iphoneos/YogaKit/YogaKit.modulemap' not found

Don't know why, but if I leave flipper in the Podfile, everything is working

@alloy
Copy link
Member

alloy commented May 28, 2020

@martinezguillaume Looks like you may need to clean up the build cache. If you can reproduce this problem in a new app, then please file a new issue.

@odemolliens
Copy link

odemolliens commented Aug 13, 2020

This is my trick to add Flipper SDK or not in my target based on a condition ($YOUR_CONDITION):

  • Add new method flipper_install
  • In react_native_pods_shared, remove use_flipper! by flipper_install
  • Adapt the $YOUR_CONDITION (eg: #{target.name}; eg for bitrise: if ENV['CI'] == "true" @ptspencer)
# Processing Flipper
def flipper_install
  ###
  # Custom way to attach or not the Flipper SDK
  ###
  if $YOUR_CONDITION
   # Don't enable Flipper
  else
   # Enables Flipper.
   #
   # Note that if you have use_frameworks! enabled, Flipper will not work and
   # you should disable these next few lines.
   use_flipper!
  end
end

def react_native_pods_shared
  (...)
  use_react_native!(:path => config["reactNativePath"])
end
  flipper_install

  post_install do |installer|
    flipper_post_install(installer)
end  

If you prefer to do it per pod target (untested code)


def react_native_pods_shared
  (...)
  use_react_native!(:path => config["reactNativePath"])
end
  flipper_install

  post_install do |installer|
    flipper_post_install(installer)
end  

def react_native_pods_shared_with_flipper
  (...)
  use_react_native!(:path => config["reactNativePath"])
end

target 'Myapp-NO-Flipper' do
  react_native_pods_shared
end

target 'Myapp-Flipper' do
  react_native_pods_shared_with_flipper
end

Another trick could be to use an extra parameters (untested code)


def react_native_pods_shared(flipper_enabled = false)
(...)
 flipper_install(flipper_enabled)
(...)
end

# Processing Flipper
def flipper_install(enabled = false)
  ###
  # Custom way to attach or not the Flipper SDK
  ###
  if enabled
   # Don't enable Flipper
  else
   # Enables Flipper.
   #
   # Note that if you have use_frameworks! enabled, Flipper will not work and
   # you should disable these next few lines.
   use_flipper!
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants