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

Undefined symbols for architecture arm64 - FlipperKitNetworkPlugin #29336

Closed
ghost opened this issue Jul 10, 2020 · 18 comments
Closed

Undefined symbols for architecture arm64 - FlipperKitNetworkPlugin #29336

ghost opened this issue Jul 10, 2020 · 18 comments
Labels
Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@ghost
Copy link

ghost commented Jul 10, 2020

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

@ghost ghost added the Needs: Triage 🔍 label Jul 10, 2020
@v-anton
Copy link

v-anton commented Jul 10, 2020

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

@oleksandr-dziuban
Copy link

oleksandr-dziuban commented Jul 10, 2020

Same issue in my project for production builds. Can you guys please check?

@oleksandr-dziuban
Copy link

@v-anton Which file should be modified for your workaround?

@v-anton
Copy link

v-anton commented Jul 11, 2020

@v-anton Which file should be modified for your workaround?

AppDelegate.m

@ghost
Copy link
Author

ghost commented Jul 11, 2020

@v-anton

On the AppDelegate.m I already have this and is not enough:

 #ifdef FB_SONARKIT_ENABLED
    //Flipper
    InitializeFlipper(application);
 #endif

@oleksandr-dziuban
Copy link

oleksandr-dziuban commented Jul 11, 2020

@v-anton Thanks, but I think this is the issue of latest [email protected] template anyway. I will use your workaround for now

@walterholohan
Copy link

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

@oleksandr-dziuban
Copy link

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

This is a bit incorrect syntax, as my IDE shows an error here...

@mtt87
Copy link

mtt87 commented Jul 15, 2020

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

@oleksandr-dziuban
Copy link

OK, thanks @mtt87

@ghost
Copy link
Author

ghost commented Jul 17, 2020

After migrate to RN 0.63.1 with the configuration below the error persists. On build settings, I have arm64, arm64e, armv7, armv7s architectures.

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

Other suggestions?

@mtt87
Copy link

mtt87 commented Jul 17, 2020

@carolinafbarros have you tried to clean build folder and rebuild from scratch?
I've also added

#if DEBUG
#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
static void InitializeFlipper(UIApplication *application) {
  FlipperClient *client = [FlipperClient sharedClient];
  SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
  [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
  [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
  [client addPlugin:[FlipperKitReactPlugin new]];
  [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
  [client start];
}
#endif
#endif

But not sure if it's related, a colleague didn't do it and it worked.

I have same architectures in build settings.

@AlessioCamm
Copy link

Those someone has problem with these process ? I try all yours solutions, but nothing work, I've always the same error...

@ArthurMorgan1899
Copy link

Thank you, perfect

@stale
Copy link

stale bot commented Dec 25, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 25, 2020
@afras21
Copy link

afras21 commented Dec 6, 2022

Any Workaround for this?

@github-actions github-actions bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label May 30, 2023
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Nov 27, 2023
Copy link

github-actions bot commented Dec 4, 2023

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as completed Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants