Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_FlipperKitNetworkPlugin" etc. for iOS production
See original GitHub issueEnvironment
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:
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
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:
- Created 3 years ago
- Reactions:4
- Comments:13
Top GitHub Comments
I had the same errors in my app after upgrading from RN
0.62.2
to0.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?
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