无法找到“反应式”的规范。

发布于 2025-01-24 11:26:48 字数 2241 浏览 1 评论 0原文

我正在尝试将一个继承的项目从React Native 0.64升级到0.68。我遇到了许多Cocoapod相关的错误,尤其是react-codegen,它不再以React-NPM软件包中的podspec存在。

奇怪的是,我无法在线引用此特定PODSPEC的其他人。这通常意味着其他问题是“红鲱鱼”。

以下是我的豆荚的子集。我想知道设置是否发生了变化,以至于我不再需要明确声明所有这些POD依赖性?有人有什么想法吗?

  pod 'React', :path => '../node_modules/react-native/', :modular_headers => false
  pod 'React-Core', :path => '../node_modules/react-native/', :modular_headers => false
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules', :modular_headers => false
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/', :modular_headers => false
  pod 'React-perflogger', :path => "../node_modules/react-native/ReactCommon/reactperflogger", :modular_headers => false # dep for DevSupport
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS', :modular_headers => false
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation', :modular_headers => false
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob', :modular_headers => false
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image', :modular_headers => false
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS', :modular_headers => false
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network', :modular_headers => false
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings', :modular_headers => false
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text', :modular_headers => false
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration', :modular_headers => false
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/', :modular_headers => false
  pod 'React-ART', :path => '../node_modules/react-native/Libraries/ART', :modular_headers => false  # No longer a pod

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact', :modular_headers => false 

I'm trying to upgrade an inherited project from React Native 0.64 to 0.68. I'm encountering a number of Cocoapod related errors, particularly around React-Codegen which no longer exists as a podspec in the react-native npm package.

The strange thing is I can't any reference online to others having this problem with this particular podspec. This usually means there is something else wrong for which this is a "red herring".

Below is a subset of my Podfile. I'm wondering whether setup has changed such that I no longer need all of these pod dependencies to be explicitly declared? Anyone have any ideas?

  pod 'React', :path => '../node_modules/react-native/', :modular_headers => false
  pod 'React-Core', :path => '../node_modules/react-native/', :modular_headers => false
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules', :modular_headers => false
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/', :modular_headers => false
  pod 'React-perflogger', :path => "../node_modules/react-native/ReactCommon/reactperflogger", :modular_headers => false # dep for DevSupport
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS', :modular_headers => false
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation', :modular_headers => false
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob', :modular_headers => false
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image', :modular_headers => false
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS', :modular_headers => false
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network', :modular_headers => false
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings', :modular_headers => false
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text', :modular_headers => false
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration', :modular_headers => false
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/', :modular_headers => false
  pod 'React-ART', :path => '../node_modules/react-native/Libraries/ART', :modular_headers => false  # No longer a pod

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact', :modular_headers => false 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

哭了丶谁疼 2025-01-31 11:26:48

在应用程序的podfile的顶部添加以下语句:

require_relative '../node_modules/react-native/scripts/react_native_pods'

我们在上述步骤中要求的文件定义了一种称为use_react_native!的方法,我们在下一步中需要。

现在调用方法use_react_native!在您的应用程序的目标名称 podfile 如下:

use_react_native! 
target 'Example' do
...
end

最后 :您的申请

$ pod install

Add the below statement at the top of your application's Podfile:

require_relative '../node_modules/react-native/scripts/react_native_pods'

The file which we are requiring in the above step defines a method called use_react_native! which we need in the next step.

Now call the method use_react_native! just before your application's target name in the Podfile as below:

use_react_native! 
target 'Example' do
...
end

Finally, run the command pod install at the root of your application

$ pod install
月野兔 2025-01-31 11:26:48

找到了满足`react-codegen(从``build/oferated/ios''')的依赖性的其他信息的其他信息规格,但是他们需要更高的最小部署目标。

更改部署后在下面的podfile中的目标为13.0,POD可以在pod install中找到兼容版本的react-codegen版本。

platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'

Was getting the same error with additional information Specs satisfying the `React-Codegen (from `build/generated/ios`)` dependency were found, but they required a higher minimum deployment target.

After changing the deployment target to 13.0 in the Podfile as per below, pod could find a compatible version of React-Codegen during pod install.

platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'
骑趴 2025-01-31 11:26:48

我得到了它!

显然,React创建一个脚本,其中包含您构建的所有标准POD需求,

因此我到目前为止所做的是在做一个反应的启动来生成默认的podfile,这与旧的podfile有很大不同,

这是基本的,基本上是

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false

target 'onboardingF2fApp' do

    config = use_native_modules!

  # Pods for onboardingF2fApp
    pod 'GooglePlaces', '3.1.0'
    pod 'GooglePlacePicker'
    pod 'GoogleMaps'

    # Flags change depending on the env values.
      flags = get_default_flags()

    use_react_native!(
      :path => config[:reactNativePath],
      # to enable hermes on iOS, change `false` to `true` and then install pods
      :hermes_enabled => flags[:hermes_enabled],
      :fabric_enabled => flags[:fabric_enabled],
      # An absolute path to your application root.
      :app_path => "#{Pod::Config.instance.installation_root}/.."
    )

end

 post_install do |installer|
  react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
 end

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

end

基本的脚本代替了所有脚本您帖子中的豆荚

require_relative '../node_modules/react-native/scripts/react_native_pods'

I got it!

apparently react create a script that contains all the standard pods needs for your build

so what I did so far was doing a react-native init to generate the default podfile which was so much different from the old one

here it is

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false

target 'onboardingF2fApp' do

    config = use_native_modules!

  # Pods for onboardingF2fApp
    pod 'GooglePlaces', '3.1.0'
    pod 'GooglePlacePicker'
    pod 'GoogleMaps'

    # Flags change depending on the env values.
      flags = get_default_flags()

    use_react_native!(
      :path => config[:reactNativePath],
      # to enable hermes on iOS, change `false` to `true` and then install pods
      :hermes_enabled => flags[:hermes_enabled],
      :fabric_enabled => flags[:fabric_enabled],
      # An absolute path to your application root.
      :app_path => "#{Pod::Config.instance.installation_root}/.."
    )

end

 post_install do |installer|
  react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
 end

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

end

basicaly this script replaces all of the pods in your post

require_relative '../node_modules/react-native/scripts/react_native_pods'
把梦留给海 2025-01-31 11:26:48

将这两条线添加在podfile的顶部。

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

然后卸下所有相关的RCT。
'POD安装'&只是建立项目。

此脚本/react_native_pods.rb做我们需要的所有RCT工作。
您可以尝试使用React-Nition进行一个新项目,以查看模板Podfile。它与以前完全不同。我尝试了0.69.5

Add this two lines on top of Podfile.

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

Then remove all RCT related pod.
'pod install' & just build project.

This scripts/react_native_pods.rb do all RCT stuff we need.
You can try with a new project with react-native init to see the template Podfile. Its totally diferent than before. I tried on 0.69.5

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文