如何修复不为 iOS 构建的 React Native App

Jak*_*ake 4 ios reactjs react-native

我在为 iOS 构建 React Native 应用程序时遇到问题。对于 android,它构建得非常好。对于 iOS,项目将构建但不存档。这是尝试存档我的项目时的错误代码:

1) Target 'React-Core.common-AccessibilityResources' has create directory command with output '/Users/jacobcarpenter/Library/Developer/Xcode/DerivedData/LFGOPocker-gaqwcsmtamkdjtbdiwhnzcvmexjk/Build/Intermediates.noindex/ArchiveIntermediates/LFGOPocker/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'
2) Target 'React-Core.common-CoreModulesHeaders-AccessibilityResources' has create directory command with output '/Users/jacobcarpenter/Library/Developer/Xcode/DerivedData/LFGOPocker-gaqwcsmtamkdjtbdiwhnzcvmexjk/Build/Intermediates.noindex/ArchiveIntermediates/LFGOPocker/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'
Run Code Online (Sandbox Code Playgroud)

几件事情要说明:运行 React-native 0.63,Podfile 和部署目标都在 11

编辑:从命令行运行时,我收到此错误

      '/Users/jacobcarpenter/Library/Developer/Xcode/DerivedData/LFGOPocker-bzowsupbiktzuzaaadvokqxbgvzq/Build/Intermediates.noindex/ArchiveIntermediates/LFGOPocker/BuildProductsPath/Release-iphoneos/YogaKit/YogaKit.modulemap'
      not found```
Run Code Online (Sandbox Code Playgroud)

Jak*_*ake 6

我通过从我的 pod 目标中删除“React-Core.common-AccessibilityResources”来修复这个错误。尝试存档时,请确保您没有使用 .xcodeproj 并使用您的工作区。即使您认为您正在使用工作区三重检查。此外,如果您尝试通过命令行归档,则必须特别说明工作区。


Wal*_*cke 5

对于对 不太有经验的人Pods,请将以下行添加到您的Podfile(RN 0.63.2) 中:

target 'yourapp' do

  # your pods go here

  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])


  # Enables Flipper.
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.

  use_flipper!
  post_install do |installer|
    flipper_post_install(installer)

    ################### ADD THE FOLLOWING #########################
    installer.pods_project.targets.each do |target|
      if target.name == "React-Core.common-AccessibilityResources"
        target.remove_from_project
      end
    end
    ###############################################################

  end
end
Run Code Online (Sandbox Code Playgroud)