software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
8.61k stars 1.26k forks source link

iOS build faied: ld: Undefined symbols #6062

Closed KingAmo closed 4 weeks ago

KingAmo commented 1 month ago

Description

xcode 15.2 use_frameworks! build failed after install react-native-reanimated

ld: Undefined symbols:
  _OBJC_CLASS_$_RCTEventDispatcher, referenced from:
      __OBJC_$_CATEGORY_RCTEventDispatcher_$_Reanimated in RCTEventDispatcher+Reanimated.o
  hermes::vm::NopCrashManager::~NopCrashManager(), referenced from:
      std::__1::default_delete<hermes::vm::NopCrashManager>::operator()[abi:v160006](hermes::vm::NopCrashManager*) const in ReanimatedRuntime.o
  facebook::jsi::HostObject::getPropertyNames(facebook::jsi::Runtime&), referenced from:
      vtable for reanimated::WorkletRuntimeCollector in REAModule.o
      vtable for reanimated::ShareableJSRef in Shareables.o
  facebook::jsi::HostObject::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&), referenced from:
      vtable for reanimated::WorkletRuntimeCollector in REAModule.o
      vtable for reanimated::ShareableJSRef in Shareables.o
  facebook::jsi::HostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&), referenced from:
      vtable for reanimated::NativeReanimatedModule in NativeReanimatedModule.o
      vtable for facebook::react::TurboModule in NativeReanimatedModule.o
      vtable for reanimated::NativeReanimatedModuleSpec in NativeReanimatedModuleSpec.o
      vtable for reanimated::WorkletRuntimeCollector in REAModule.o
      vtable for reanimated::ShareableJSRef in Shareables.o
      vtable for reanimated::WorkletRuntime in WorkletRuntime.o
  facebook::jsi::HostObject::~HostObject(), referenced from:
      facebook::react::TurboModule::~TurboModule() in NativeReanimatedModule.o
      reanimated::WorkletRuntimeCollector::WorkletRuntimeCollector(facebook::jsi::Runtime&) in REAModule.o
      reanimated::WorkletRuntimeCollector::~WorkletRuntimeCollector() in REAModule.o
      facebook::jsi::DecoratedHostObject::~DecoratedHostObject() in ReanimatedHermesRuntime.o
      reanimated::ShareableJSRef::~ShareableJSRef() in Shareables.o
      reanimated::WorkletRuntime::WorkletRuntime(facebook::jsi::Runtime&, std::__1::shared_ptr<facebook::react::MessageQueueThread> const&, std::__1::shared_ptr<reanimated::JSScheduler> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in WorkletRuntime.o
      reanimated::WorkletRuntime::~WorkletRuntime() in WorkletRuntime.o

Steps to reproduce

yarn add react-native-reanimated
pod install run project in xcode

Snack or a link to a repository

no

Reanimated version

3.11.0

React Native version

0.73.8

Platforms

iOS

JavaScript runtime

Hermes

Workflow

None

Architecture

Paper (Old Architecture)

Build type

Debug app & dev bundle

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

github-actions[bot] commented 1 month ago

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Snack or a link to a repository section.

github-actions[bot] commented 1 month ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

KingAmo commented 1 month ago
    pre_install do |installer|
     installer.pod_targets.each do |pod|
       if pod.name.eql?('RNReanimated')
         def pod.build_type
           Pod::BuildType.static_library
         end
       end
      end
    end

add this lines in podfile follow https://github.com/software-mansion/react-native-screens/issues/842#issuecomment-790498006, i can finally build success,