iOS Development

i cant run previous react native code on xcode (15.2) with m1 mac however works wonderful on intel mac [duplicate]

Spread the love


operating an previous react native code on xcode has this error

enter image description here

however exhibits this within the console
enter image description here

solely encountering this on m1 mac however not intel mac

that is the podfile

platform :ios, '12.0'
# Override Firebase SDK Model
$FirebaseSDKVersion = '6.34.0'
#$FirebaseSDKVersion = '8.2.0'

require_relative '../node_modules/react-native-unimodules/cocoapods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

goal 'helath22' do
  rnPrefix = "../node_modules/react-native"

  # React Native and its dependencies
  pod 'FBLazyVector', :path => "#{rnPrefix}/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "#{rnPrefix}/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "#{rnPrefix}/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "#{rnPrefix}/Libraries/TypeSafety"
  pod 'React', :path => "#{rnPrefix}/"
  pod 'React-Core', :path => "#{rnPrefix}/"
  pod 'React-CoreModules', :path => "#{rnPrefix}/React/CoreModules"
  pod 'React-RCTActionSheet', :path => "#{rnPrefix}/Libraries/ActionSheetIOS"
  pod 'React-RCTAnimation', :path => "#{rnPrefix}/Libraries/NativeAnimation"
  pod 'React-RCTBlob', :path => "#{rnPrefix}/Libraries/Blob"
  pod 'React-RCTImage', :path => "#{rnPrefix}/Libraries/Picture"
  pod 'React-RCTLinking', :path => "#{rnPrefix}/Libraries/LinkingIOS"
  pod 'React-RCTNetwork', :path => "#{rnPrefix}/Libraries/Community"
  pod 'React-RCTSettings', :path => "#{rnPrefix}/Libraries/Settings"
  pod 'React-RCTText', :path => "#{rnPrefix}/Libraries/Textual content"
  pod 'React-RCTVibration', :path => "#{rnPrefix}/Libraries/Vibration"
  pod 'React-Core/RCTWebSocket', :path => "#{rnPrefix}/"
  pod 'React-Core/DevSupport', :path => "#{rnPrefix}/"
  pod 'React-cxxreact', :path => "#{rnPrefix}/ReactCommon/cxxreact"
  pod 'React-jsi', :path => "#{rnPrefix}/ReactCommon/jsi"
  pod 'React-jsiexecutor', :path => "#{rnPrefix}/ReactCommon/jsiexecutor"
  pod 'React-jsinspector', :path => "#{rnPrefix}/ReactCommon/jsinspector"
  pod 'ReactCommon/jscallinvoker', :path => "#{rnPrefix}/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "#{rnPrefix}/ReactCommon"
  pod 'Yoga', :path => "#{rnPrefix}/ReactCommon/yoga"
  pod 'DoubleConversion', :podspec => "#{rnPrefix}/third-party-podspecs/DoubleConversion.podspec"
  pod 'glog', :podspec => "#{rnPrefix}/third-party-podspecs/glog.podspec"
  pod 'Folly', :podspec => "#{rnPrefix}/third-party-podspecs/Folly.podspec"
  pod 'Protobuf', '= 3.22.1' 
  # Different native modules

  # Robotically detect put in unimodules
  use_unimodules!

  # react-native-cli autolinking
  use_native_modules!
finish

post_install do |installer|
  ## Repair for XCode 12.5
  find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
  "_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")
  find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm",
      "RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass(Class(module)))")
  find_and_replace("../node_modules/react-native/Libraries/Picture/RCTUIImageViewAnimated.m",
      "_currentFrame.CGImage;","_currentFrame.CGImage ;} else { [super displayLayer:layer];")
finish

def find_and_replace(dir, findstr, replacestr)
  Dir[dir].every do |title|
      textual content = File.learn(title)
      substitute = textual content.gsub(findstr,replacestr)
      if textual content != substitute
          places "Repair: " + title
          File.open(title, "w")  file.places substitute 
          STDOUT.flush
      finish
  finish
  Dir[dir + '*/'].every(&methodology(:find_and_replace))
finish

i think this solely works for xcode 12 however i do not know how you can replace it with out breaking one thing. I am utilizing an m1 mac with code 15.2

Leave a Reply

Your email address will not be published. Required fields are marked *