question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_FlipperKitNetworkPlugin" etc. for iOS production

See original GitHub issue

Environment

System:
    OS: macOS 10.15.3
    CPU: (4) x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
    Memory: 49.42 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 14.2.0 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.14.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.8.4 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 26, 28, 29
      Build Tools: 26.0.2, 28.0.3, 29.0.1, 29.0.2
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.4/11E146 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_212 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: 3.1.0 => 3.1.0 
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.1 => 0.63.1 
  npmGlobalPackages:
    *react-native*: Not Found

Upgrading version

0.63.2

Description

I upgraded from React Native 0.62.2 to 0.63.1 manually using the upgrade helper, because the automatic helper wasn’t working. The application builds successfully in Debug (Product -> Scheme -> Build Configuration -> Debug), but fails for the Release build configuration with the following error:

image

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_FlipperKitNetworkPlugin", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_SKIOSNetworkAdapter", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_FlipperKitReactPlugin", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_FKUserDefaultsPlugin", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_FlipperKitLayoutPlugin", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_SKDescriptorMapper", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_FlipperClient", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Reproducible demo

AppDelegate.m.txt Podfile.txt

Attached is my Podfile and AppDelegate.m (added txt so that it would upload to Github). Looking at the upgrade helper, I should mention that I have the following in AppDelegate.m. I also tried commenting out the #ifdef FB_SONARKIT_ENABLED and #endif but it still failed.

#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

and in didFinishLaunchingWithOptions:

  #ifdef FB_SONARKIT_ENABLED
    InitializeFlipper(application);
  #endif

In the Podfile, the only differences from the sample are the app name, OneSignal extension, and expo unimodules. Thanks for the help in advance!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:13

github_iconTop GitHub Comments

21reactions
curiousdustincommented, Jul 23, 2020

I had the same errors in my app after upgrading from RN 0.62.2 to 0.63.2.

I was able to get my app to build for release by removing this line from Build Settings > Other C Flags > Release

-DFB_SONARKIT_ENABLED=1

I have no idea if this is a proper way to fix this or not. Can anyone confirm?

5reactions
Taylor123commented, Jul 25, 2020

setting -DFB_SONARKIT_ENABLED=1 shouldn’t be a proper fix for this since Flipper shouldn’t be enabled in release builds. With that said, i’m facing the same issue at the moment, so i’m looking for a better fix

Read more comments on GitHub >

github_iconTop Results From Across the Web

Undefined symbols for architecture x86_64 on Xcode 6.1
I solved the same issue by going to Xcode Build Settings and in Architectures, I changed the Xcode 6.1.1 standard architecture to:- $(ARCHS_STANDARD_32_BIT)....
Read more >
Undefined symbols for architecture x86_64
I'm trying to create an application that sends keystrokes to another process and I keep getting this error: Undefined symbols for architecture x86_64:....
Read more >
Undefined Symbol On Xcode With Custom Library For Ios ...
Undefined symbols for architecture x8664 : by set the minimum target OS as 10.11 but ... x8664: OBJCCLASSFlipperKitNetworkPlugin etc.for iOS production #90.
Read more >
UnityFramework Plugin won't compile (undefined symbols ...
ld: symbol(s) not found for architecture x86_64 ... The built Unity-iPhone.xcodeproj w/ the plugin compiles/runs fine independently in the ...
Read more >
undefined symbols for architecture arm64 xcode 12
I hope you can help! I am building an iOS app in xCode 12 and under unity framework I am getting the following...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found