facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.15k stars 24.32k forks source link

React-jsi error FBStrign No type named 'reference' in 'std::allocator<char>' #47366

Closed himanshukr17 closed 4 days ago

himanshukr17 commented 4 days ago

Description

I am getting this issue while build in xcode below is my podfile `require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '12.1'

target 'vinderpos3' do config = use_native_modules!

pod 'Firebase', :modular_headers => true pod 'FirebaseCore', :modular_headers => true pod 'GoogleUtilities', :modular_headers => true $RNFirebaseAsStaticFramework = true

use_react_native!(:path => config["reactNativePath"])

pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'

pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

pod 'react-native-blur', :path => '../node_modules/@react-native-community/blur'

pod 'RNSVG', :path => '../node_modules/react-native-svg'

pod 'FBReactNativeSpec', :path => "../node_modules/react-native/React/FBReactNativeSpec"

pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'

pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'

pod 'react-native-onesignal', :path => '../node_modules/react-native-onesignal'

pod 'RNImageCropPicker', :path => '../node_modules/react-native-image-crop-picker'

pod 'react-native-pager-view', :path => '../node_modules/react-native-pager-view'

pod 'RealmJS', :path => '../node_modules/realm'

pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'

pod 'react-native-location', :path => '../node_modules/react-native-location'

target 'vinderpos3Tests' do

use_modular_headers!

inherit! :complete
# Pods for testing

end

Enables Flipper.

#

Note that if you have use_frameworks! enabled, Flipper will not work and

you should disable these next few lines.

use_flipper! post_install do |installer| flipper_post_install(installer) fix_library_search_paths(installer) bitcode_strip_path = xcrun --find bitcode_strip.chop! def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path) framework_path = File.join(Dir.pwd, framework_relative_path) command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}" puts "Stripping bitcode: #{command}" system(command) end

framework_paths = [ "Pods/LogRocket/LogRocket.xcframework/ios-arm64/LogRocket.framework/LogRocket", "Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/hermes", "Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/Versions/Current/hermes", "Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64/hermes.framework/hermes", "Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64_x86_64-maccatalyst/hermes.framework/hermes", "Pods/OpenSSL-Universal/Frameworks/OpenSSL.xcframework/ios-arm64_arm64e_armv7_armv7s/OpenSSL.framework/OpenSSL" ]

framework_paths.each do |framework_relative_path| strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path) end end end

def fix_library_search_paths(installer) def fix_config(config) lib_search_paths = config.build_settings["LIBRARY_SEARCH_PATHS"] if lib_search_paths if lib_search_paths.include?("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)") || lib_search_paths.include?("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"")

$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) causes problem with Xcode 12.5 + arm64 (Apple M1)

    # since the libraries there are only built for x86_64 and i386.
    lib_search_paths.delete("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)")
    lib_search_paths.delete("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"")
    if !(lib_search_paths.include?("$(SDKROOT)/usr/lib/swift") || lib_search_paths.include?("\"$(SDKROOT)/usr/lib/swift\""))
      # however, $(SDKROOT)/usr/lib/swift is required, at least if user is not running CocoaPods 1.11
      lib_search_paths.insert(0, "$(SDKROOT)/usr/lib/swift")
    end
  end
end

end

projects = installer.aggregate_targets .map{ |t| t.user_project } .uniq{ |p| p.path } .push(installer.pods_project)

projects.each do |project| project.build_configurations.each do |config| fix_config(config) end project.native_targets.each do |target| target.build_configurations.each do |config| fix_config(config) end end project.save() end end

target 'vinderpos3-tvOS' do

Pods for vinderpos3-tvOS

target 'vinderpos3-tvOSTests' do inherit! :search_paths

Pods for testing

end end `

Steps to reproduce

  1. Install pods using pod install
  2. After press Cmmand + B for build
  3. Notice the crash

React Native Version

0.64.4

Affected Platforms

Build - MacOS

Output of npx react-native info

(node:31325) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
System:
    OS: macOS 15.0.1
    CPU: (8) arm64 Apple M1
    Memory: 95.73 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    Yarn: 1.22.19 - ~/Downloads/Applications/Suprsales_master/Suprsales-1/node_modules/.bin/yarn
    npm: 6.14.18 - ~/Downloads/Applications/Suprsales_master/Suprsales-1/node_modules/.bin/npm
    Watchman: 2024.10.28.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.16.1 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 24.1, iOS 18.1, macOS 15.1, tvOS 18.1, visionOS 2.1, watchOS 11.1
    Android SDK:
      Android NDK: 22.1.7171670
  IDEs:
    Android Studio: 2022.1 AI-221.6008.13.2211.9514443
    Xcode: 16.1/16B40 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.17 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: ^16.13.1 => 16.14.0 
    react-native: ^0.64.4 => 0.64.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Stacktrace or Logs

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:80B5010D-F5B8-47DF-AEAE-1A7AEF6C5829, OS:17.2, name:iPhone 12 }
{ platform:iOS Simulator, id:80B5010D-F5B8-47DF-AEAE-1A7AEF6C5829, OS:17.2, name:iPhone 12 }
** BUILD FAILED **

The following build commands failed:
        CompileC /Users/himanshu/Library/Developer/Xcode/DerivedData/vinderpos3-gkmmophvwdzejxctlpmeajuhqcad/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-jsi.build/Objects-normal/arm64/JSIDynamic.o /Users/himanshu/Downloads/Applications/Suprsales_master/Suprsales-1/node_modules/react-native/ReactCommon/jsi/jsi/JSIDynamic.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-jsi' from project 'Pods')
        Building workspace vinderpos3 with scheme vinderpos3 and configuration Debug
(2 failures)

Reproducer

https://github.com/Samishti-technical/Suprsales

Screenshots and Videos

Screenshot 2024-11-04 at 11 39 15
react-native-bot commented 4 days ago
:warning: Too Old Version of React Native
:information_source: It looks like your issue or the example you provided uses a Too Old Version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.
react-native-bot commented 4 days ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
react-native-bot commented 4 days ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
react-native-bot commented 4 days ago
:warning: Too Old Version of React Native
:information_source: It looks like your issue or the example you provided uses a Too Old Version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.