Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 关于react native的播客文件问题_React Native - Fatal编程技术网

React native 关于react native的播客文件问题

React native 关于react native的播客文件问题,react-native,React Native,我目前正试图在Mac上安装我的第一个RN应用程序。我对iPhone开发和Mac电脑都是新手。所以我当然在学习和调试的过程中。显然,论坛上的不同人士推荐了各种不同的方法来解决各种不同的问题。在Mac上,本机iOS开发和RN应用程序配置之间存在一些重叠 我有一些关于播客文件的问题。有时论坛上的人出于各种原因建议更新Podfile。但我想我已经读到了至少一位开发人员的评论,说Podfile不应该手动更新。从RN应用程序配置的角度来看,您对此有何看法 作为一个建议解决方案的一部分,一位开发人员建议删除P

我目前正试图在Mac上安装我的第一个RN应用程序。我对iPhone开发和Mac电脑都是新手。所以我当然在学习和调试的过程中。显然,论坛上的不同人士推荐了各种不同的方法来解决各种不同的问题。在Mac上,本机iOS开发和RN应用程序配置之间存在一些重叠

我有一些关于播客文件的问题。有时论坛上的人出于各种原因建议更新Podfile。但我想我已经读到了至少一位开发人员的评论,说Podfile不应该手动更新。从RN应用程序配置的角度来看,您对此有何看法

作为一个建议解决方案的一部分,一位开发人员建议删除Podfile.lock文件。在我看来,在Podfile上放置.lock是有原因的。为了保持某种类型的完整性,等等。那么您是否会在故障排除过程中手动删除Podfile.lock文件?或者,您是否仅通过执行其他类型的更结构化的流程来间接执行此操作?

对于RN版本0.60+而言,您几乎不需要接触pod文件。 除非:

1)您有一些旧的react本机库依赖项,不支持自动链接或

2)需要将目标平台从
platform:ios,“9.0”
更改为更新或更高版本

3)需要一些外部SDK依赖项,并且必须添加一些行,如
pod“Google Mobile Ads SDK”

只需转到ios文件夹并运行

pod安装

pod安装——回购更新

将安装所有React库以及您添加的
warn
npm
(支持自动链接)库

对于较旧的库,您应该得到一些警告,它们无法链接,您应该只使用
react native link
,或者只在pod文件中添加一行,然后再次运行
pod install

更多详情: 这是基本应用程序(称为RnDiffApp)的RN 0.61.4 pod文件的外观:

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

target 'RnDiffApp' do
  # Pods for RnDiffApp
  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 'RnDiffAppTests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end

target 'RnDiffApp-tvOS' do
  # Pods for RnDiffApp-tvOS

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

end
使用本机模块
只会告诉CocoaPods安装(当您运行pod安装时)支持自动链接的node_模块中的所有本机DEP

对于那些在运行
pod install
时来自节点\单元模块的本机依赖项,您应该看到如下注意事项:

检测到RNCAsyncStorage、RNDeviceInfo的React本机模块吊舱


当您需要添加一些第三方CoCoaPod以在本机代码中使用时,您不需要触摸
Podfile.lock

修改Podfile。否则,如果您只是使用npm软件包,您不需要修改podfileok,因此如果我只是尝试根据我已经在windows for android上编写和测试的代码在mac上配置和构建ios应用程序,那么应该不需要触摸podfile,对吗?是的。。。如果您有需要额外安装的第三方软件包,只需在iOS文件夹中运行“pod安装”。