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

Build failed on the RN 0.71.3 [IOS] #245

Open
BohdanPylypchuk opened this issue Mar 7, 2023 · 8 comments
Open

Build failed on the RN 0.71.3 [IOS] #245

BohdanPylypchuk opened this issue Mar 7, 2023 · 8 comments

Comments

@BohdanPylypchuk
Copy link

BohdanPylypchuk commented Mar 7, 2023

react-native: 0.71.3
react-native-share-menu: 6.0.0

Can't build an ios app on the react-native 0.71.3

Build error:

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

image

@scottnash
Copy link

scottnash commented Mar 8, 2023

Try adding flipper_configuration to the use_react_native in the share extension target of your pod file

target 'ShareExtension' do
  use_react_native!(:flipper_configuration => flipper_config)

@karuzo17
Copy link

@scottnash doesn't work for me. Can you maybe share your complete Podfile? Maybe I am missing something. Thanks

@scottnash
Copy link

@karuzo17 did you remember to rerun pod install after making the change?

@dongsuo
Copy link

dongsuo commented Jul 10, 2023

I fixed this error by adding this to my target 'share_extension_name' do

  config = use_native_modules!

  # use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
  # use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']

  # Flags change depending on the env values.
  flags = get_default_flags()
  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/..",
    # Note that if you have use_frameworks! enabled, Flipper will not work if enabled
    # :flipper_configuration => flipper_config
    :flipper_configuration => !ENV['CI'] ? FlipperConfiguration.enabled(["Debug"], { 'Flipper' => '0.184.0' }) : FlipperConfiguration.disabled,
  )

For anyone who maybe meet this problem too.

@asadraza4522
Copy link

react-native: 0.72.1
react-native-share-menu: 6.0.0

Can't build an ios app on the react-native 0.72.1

Build error:

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

I have fixed this error by adding this to my target 'share_extension_name' do

target 'share_extension_name' do
  use_react_native!(
    :hermes_enabled => true,
    :flipper_configuration => flipper_config,
  )

  pod 'RNShareMenu', :path => '../node_modules/react-native-share-menu'
  # Manually link packages here to keep your extension bundle size minimal
end

@zabojad
Copy link

zabojad commented Oct 19, 2023

Try adding flipper_configuration to the use_react_native in the share extension target of your pod file

target 'ShareExtension' do
  use_react_native!(:flipper_configuration => flipper_config)

That fixed it for me on RN 0.72.4

@allenjhyang
Copy link

Try adding flipper_configuration to the use_react_native in the share extension target of your pod file

target 'ShareExtension' do
  use_react_native!(:flipper_configuration => flipper_config)

This seemed to help me as well

@gbyesiltas
Copy link

Try adding flipper_configuration to the use_react_native in the share extension target of your pod file

target 'ShareExtension' do
  use_react_native!(:flipper_configuration => flipper_config)

This worked for me as well 👍 Can we update the instructions? :D #310

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants