react native ios - Undefined symbols for architecture x86_64

clang, objective-c, react-native, xcode

Solution

I had the same problem on m1, doing this helped me solve the problem:

Modify the Build Settings -> Excluded Architectures option, add the Any iOS Simulator SDK option, and set the value to arm64.As shown in the figure:

and add the following code in Podfile:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = "arm64"
    end
  end
end

Problem

I have built a react native app that runs fine in android.....but when I try to build in ios I get the following error: `Undefined symbols for architecture x86_64` It appears to be linked in some way to flipper, as the detailed errors are as below: ``` link with file built for iOS Simulator-arm64 Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_FlipperKitNetworkPlugin", referenced from: objc-class-ref in AppDelegate.o "_OBJC_CLASS_$_FlipperKitReactPlugin", 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 "_OBJC_CLASS_$_RNCPushNotificationIOS", referenced from: objc-class-ref in AppDelegate.o "_OBJC_CLASS_$_FlipperKitLayoutPlugin", referenced from: objc-class-ref in AppDelegate.o "_OBJC_CLASS_$_RCTRootView", referenced from: objc-class-ref in AppDelegate.o "_OBJC_CLASS_$_RCTBridge", referenced from: objc-class-ref in AppDelegate.o "_OBJC_CLASS_$_SKIOSNetworkAdapter", referenced from: objc-class-ref in AppDelegate.o "_OBJC_CLASS_$_RCTBundleURLProvider", referenced from: objc-class-ref in AppDelegate.o "_OBJC_CLASS_$_FBSDKApplicationDelegate", referenced from: objc-class-ref in AppDelegate.o "_OBJC_CLASS_$_FIRApp", referenced from: objc-class-ref in AppDelegate.o "_OBJC_CLASS_$_FKUserDefaultsPlugin", referenced from: objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ```

Original source

Related problems