react-native-share-menu icon indicating copy to clipboard operation
react-native-share-menu copied to clipboard

Hermes

Open anatooly opened this issue 2 years ago • 1 comments

Original Podfile from documentation

Undefined symbol: vtable for facebook::react::HermesExecutorFactory

Undefined symbol: Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer<A>) -> (Swift.IndexingIterator<Swift._ArrayBuffer<A>>, Swift.Int)

Undefined symbols for architecture x86_64:
  "vtable for facebook::react::HermesExecutorFactory", referenced from:
      facebook::react::HermesExecutorFactory::HermesExecutorFactory(std::__1::function<void (facebook::jsi::Runtime&)>, std::__1::function<void (std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>)> const&, hermes::vm::RuntimeConfig) in libReact-Core.a(RCTCxxBridge.o)
      facebook::react::HermesExecutorFactory::~HermesExecutorFactory() in libReact-Core.a(RCTCxxBridge.o)
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer<A>) -> (Swift.IndexingIterator<Swift._ArrayBuffer<A>>, Swift.Int)", referenced from:
      generic specialization <serialized, Swift._ArrayBuffer<Swift.Int8>> of Swift._copyCollectionToContiguousArray<A where A: Swift.Collection>(A) -> Swift.ContiguousArray<A.Element> in ShareViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Podfile

target 'ShareExtension' do
  config = use_native_modules!
  
  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => true
  )

  pod 'RNShareMenu', :path => '../node_modules/react-native-share-menu'
  # Manually link packages here to keep your extension bundle size minimal
end
ld: warning: linking against a dylib which is not safe for use in application extensions: /Users/***/Library/Developer/Xcode/DerivedData/***-ghcylmplrjekkobhdyselijxcqrd/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/hermes/hermes.framework/hermes
Undefined symbols for architecture x86_64:
  "Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer<A>) -> (Swift.IndexingIterator<Swift._ArrayBuffer<A>>, Swift.Int)", referenced from:
      generic specialization <serialized, Swift._ArrayBuffer<Swift.Int8>> of Swift._copyCollectionToContiguousArray<A where A: Swift.Collection>(A) -> Swift.ContiguousArray<A.Element> in ShareViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I think problem on this line: let selectorOpenURL = sel_registerName("openURL:") like this https://github.com/ajith-ab/react-native-receive-sharing-intent/issues/68

anatooly avatar Sep 30 '21 14:09 anatooly

Some solved for correct deploy:

    let string = UnsafePointer(Array("openURL:".utf8CString))
    let selectorOpenURL = sel_registerName(string)

anatooly avatar Sep 30 '21 15:09 anatooly