react-native: Undefined symbols for architecture arm64 - FlipperKitNetworkPlugin

Description

After using the upgrade helper, in order to update to the last version of RN (0.63.0) I had some build errors related to Flipper.

Upgrade helper: https://react-native-community.github.io/upgrade-helper/?from=0.62.2&to=0.63.0

React Native version:

System:
    OS: macOS 10.15.5
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 1.12 GB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.13.4 - ~/.nvm/versions/node/v12.16.1/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.1 - /Users/barrosc/.rvm/gems/ruby-2.7.0/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode: 11.5/11E608c - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_211 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.0 => 0.63.0 

Steps To Reproduce

  1. ios folder: pod install
  2. root folder: react-native run-ios

Expected Results

Expected to build and successfully launch the app

Snack, code example, screenshot, or link to a repository:

Build Settings

Valid Architectures: arm64 arm64e armv7 armv7s

Podfile

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'

target 'my_app' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])
  
  target 'app_tests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!
  post_install do |installer|
    flipper_post_install(installer)
    end
  end
end

Build Error Screenshot 2020-07-10 at 18 29 10

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 10
  • Comments: 18

Most upvoted comments

Defining extra #if DEBUG above Flipper init code works for me

Thanks @v-anton, I’ve used your workaround too. appDelegate.m needs to be updated to

#if DEBUG
#ifdef FB_SONARKIT_ENABLED
  InitializeFlipper(application);
#endif
#endif

I confirm on RN 0.63.1 this worked for me and I don’t have any alert from Xcode that it’s incorrect syntax.

#if DEBUG
#ifdef FB_SONARKIT_ENABLED
  InitializeFlipper(application);
#endif
#endif