ios - ld : library not found for -lRCTAnimation

标签 ios xcode react-native podfile

描述

react native版本升级到0-62.2后,遇到了很多问题。这是以下问题中的其中一个:

-- 我把这个页面作为引用并编辑了它 https://react-native-community.github.io/upgrade-helper/?from=0.59.3&to=0.62.0

React Native 版本:

react native 客户端:2.0.1

native react :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> 构建阶段 > 将二进制文件与库链接

enter image description here

最佳答案

你能尝试删除 Xcode 中所有链接的 React Native 库吗?

  1. 在 Xcode 中打开 Project.xcworkspace 文件
  2. 转到项目导航器选项卡
  3. 转到构建阶段选项卡
  4. 然后在 Link Binary With Libraries 部分下: Remove all binaries -libRCT*

RN 60+ 现在包含在 Pods 项目中。

关于ios - ld : library not found for -lRCTAnimation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61455103/

相关文章:

javascript - react-native-router-flux 无法改变背景颜色

ios - 以编程方式通过 uibutton 删除 uiview

ios - 如何为表格上的不同 URL 组织详细信息 Controller webview?

ios - 金刚鹦鹉 iOS - 点击动画或反转

xcode - 对于关键错误,此类不符合键值编码?

xcode - viewDidLoad() 中的 addSubview() 不起作用

ios - 如何在 Xcode 中默认 “View as” 设备 - Main.Storyboard

ios - "None of your accounts are a member of XXXXX"尝试设置应用程序组

javascript - 我如何制作一个计时器?

react-native - 可触摸的不透明度会扰乱行容器中的宽度