2

Description

After react native version upgradiong to 0-62.2, I encountered many problems. This is one of them in the following question:

-- I took this page for reference and edited it https://react-native-community.github.io/upgrade-helper/?from=0.59.3&to=0.62.0

React Native version:

react-native-cli: 2.0.1

react-native: 0.62.2

**Expected Results**
clang: error: linker command failed with exit code 1 (use -v to see invocation)

ld: library not found for -lRCTAnimation
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 6.0, but the range of supported deployment target versions is 8.0 to 13.4.99. (in target 'OpenSSL-Universal' from project 'Pods')

** BUILD FAILED **


The following build commands failed:
        Ld /Users/ibrahimyolbir/Library/Developer/Xcode/DerivedData/DGFonder-fxqthwkcalsxjgaeqbdxsodcnrou/Build/Products/Debug-iphonesimulator/DGFonder.app/DGFonder normal x86_64
(1 failure)
**Podfile**

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'


def flipper_pods()
  flipperkit_version = '0.34.0'
  pod 'FlipperKit', '~>' + flipperkit_version, :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
  pod 'FlipperKit/SKIOSNetworkPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitUserDefaultsPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitReactPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
end

# Post Install processing for Flipper
def flipper_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'YogaKit'
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '4.1'
      end
    end
  end
  file_name = Dir.glob("*.xcodeproj")[0]
  app_project = Xcodeproj::Project.open(file_name)
  app_project.native_targets.each do |target|
    target.build_configurations.each do |config|
      cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '
      unless cflags.include? '-DFB_SONARKIT_ENABLED=1'
        puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'
        cflags << '-DFB_SONARKIT_ENABLED=1'
      end
      config.build_settings['OTHER_CFLAGS'] = cflags
    end
    app_project.save
  end
  installer.pods_project.save
end



target 'DGFonder' do
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/Yoga', :modular_headers => true
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  use_native_modules!


  target 'DGFonderTests' do
    inherit! :search_paths
    # Pods for testing
  end
  flipper_pods()
  post_install do |installer|
    flipper_post_install(installer)
    installer.pods_project.targets.each do |target|
      if target.name == 'react-native-config'
        phase = target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
        phase.shell_script = "cd ../../"\
                             " && RNC_ROOT=./node_modules/react-native-config/"\
                             " && export SYMROOT=$RNC_ROOT/ios/ReactNativeConfig"\
                             " && export BUILD_DIR=$RNC_ROOT/ios/ReactNativeConfig"\
                             " && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.ruby"

        target.build_phases << phase
        target.build_phases.move(phase,0)
      end
    end

  end
end

ProjectName> Build phases > Link Binary With Libraries

enter image description here

Ibrahim Yolbir
  • 139
  • 2
  • 14
  • A lot of stuff change in RN 0.60+. Did you try do remove the node_module folder then npm install + pod install ? – CR7 Apr 27 '20 at 08:59
  • Yes i did. i searching everywhere -lRCTAnimation even google. But i cant find anything about it. Do you know why it is there " -l " at the start of -lRCTAnimation – Ibrahim Yolbir Apr 27 '20 at 09:12

1 Answers1

7

Can you try to remove all the linked React Native library in Xcode ?

  1. Open Project.xcworkspace file in Xcode
  2. Go to project navigator tab
  3. Go to Build Phases tab
  4. Then under Link Binary With Libraries section: Remove all binaries -libRCT*

With RN 60+ there are now included in the Pods project.

CR7
  • 581
  • 4
  • 9
  • Thank you i removed all -libRCT binaries. I uploaded my " Link Binary With Libraries" as image above you can see it I passe this error. Now i have another errors :) – Ibrahim Yolbir Apr 27 '20 at 12:18
  • Dou you have any idea about this one; ld: library not found for -BVLinearGradient – Ibrahim Yolbir Apr 27 '20 at 13:02
  • @IbrahimYolbir Yes you should check the doc of the package, it will tell you how to install properly. Usually you have 3 solutions depending of the version of RN you are using 1) just npm install the package 2) or react-native link the package 3) or sometimes you will need to add the path of the package in the Podfile and then run a pod install – CR7 Apr 27 '20 at 13:19
  • Hi thank you for your answer. I used npx react-native upgrade command for upgrade RN. I tested. 3) or sometimes you will need to add the path of the package in the Podfile and then run a pod install its not helped. I mean i added this pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient' to Podfile. – Ibrahim Yolbir Apr 27 '20 at 13:43
  • Did you try this to upgrade: https://react-native-community.github.io/upgrade-helper/ – CR7 Apr 27 '20 at 13:53
  • Yes i changed all files – Ibrahim Yolbir Apr 27 '20 at 14:03
  • This is the same problem happening with me as well. Had been struggling since last couple of days into it and still no solution. – Jeet May 05 '20 at 21:29