Skip to content

RNCSliderComponentView.mm fails on legacy Architecture #744

@razvanphp

Description

@razvanphp

Error

❌  (node_modules/@react-native-community/slider/ios/RNCSliderComponentView.mm:5:9)

  3 | #import <React/RCTConversions.h>
  4 |
	⁠5 | #import <react/renderer/components/RNCSlider/RNCSliderComponentDescriptor.h>
    |         ^ 'react/renderer/components/RNCSlider/RNCSliderComponentDescriptor.h' file not found
  6 | #import <react/renderer/components/RNCSlider/EventEmitters.h>
  7 | #import <react/renderer/components/RNCSlider/Props.h>
  8 | #import <react/renderer/components/RNCSlider/RCTComponentViewHelpers.h>
  • are you using the new architecture?

NO, this is probably the reason of the error.

  • which version of react & react-native are you using?
"expo": "~54.0.22"
"react": "19.1.0"
"react-native": "0.81.5"

Description

Fix by patch, vibe-coded

diff --git a/node_modules/@react-native-community/slider/react-native-slider.podspec b/node_modules/@react-native-community/slider/react-native-slider.podspec
index 54d77bd..be7edb9 100644
--- a/node_modules/@react-native-community/slider/react-native-slider.podspec
+++ b/node_modules/@react-native-community/slider/react-native-slider.podspec
@@ -16,7 +16,13 @@ Pod::Spec.new do |s|
   s.platforms    = { :ios => "9.0", :visionos => "1.0" }
 
   s.source       = { :git => "https://github.com/callstack/react-native-slider.git", :tag => "v#{s.version}" }
-  s.source_files = "ios/*/.{h,m,mm}"
+  
+  if new_arch_enabled
+    s.source_files = "ios/*/.{h,m,mm}"
+  else
+    s.source_files = "ios/*/.{h,m}"
+    s.exclude_files = "ios/**/RNCSliderComponentView.{h,mm}"
+  end
 
   if new_arch_enabled
     s.subspec "common" do |ss|

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    To be analyzed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions