且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我的本地人在构建tvOS时遇到问题,但iOS成功

更新时间:2023-11-23 16:27:28

如果使用的是可可豆,而不要使用 .xcworkspace 文件,默认的 .xcodeproj 文件。


I followed the link below to install new reactNative App ..

https://facebook.github.io/react-native/docs/getting-started

After Successfully Installed I am able to run the iOS target but not tvOS while running tvOS I am getting below error ..

Library not found for -lPods-AwesomeProject-tvOS

It seems in podfile cocoapods not included for tvos target .. So I added cocoaPods for tvos target and then build again but getting below warning and errors..

I am also adding my Podfile here please suggest any changes

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

  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/jscallinvoker', :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'

  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'

  target 'ReactNativeSampleTests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end

target 'ReactNativeSample-tvOS' do
  # Pods for ReactNativeSample-tvOS
platform :tvos, '9.2'

All same pods in above target included here as well..

  target 'ReactNativeSample-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end ```

Cause if you're using cocoapods and don't use the .xcworkspace file instead of the default .xcodeproj file.