簡體   English   中英

如何修復未為 iOS 構建的 React Native App

[英]How to fix React Native App not building for iOS

我在為 iOS 構建我的 react 本機應用程序時遇到問題。 對於 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'

state 的幾件事:運行 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```

我通過從我的 pod 目標中刪除“React-Core.common-AccessibilityResources”來修復此錯誤。 嘗試存檔時,請確保您沒有使用 .xcodeproj 並使用您的工作區。 即使您認為您正在使用工作區三重檢查。 此外,如果您嘗試通過命令行存檔,則必須特別指定 state 工作區。

編輯:我通過使用我的 Podfile 從目標中刪除僅 React-Core.common-AccessibilityResources 來修復構建問題。

(我想回復傑克的回答,但我還沒有足夠的聲譽來發表評論)

我嘗試修改我的 Podfile 以從 Pods 項目中排除這兩個目標(React-Core.common-AccessibilityResources 和 React-Core.common-CoreModulesHeaders-AccessibilityResources)。 它開始編譯,但最終還是失敗了,說AccessibilityResources.bundle不存在。

雖然切換到舊版構建系統(在工作區設置中)似乎可以解決 AccessibilityResources 問題,但還會出現其他問題(主要是關於 Swift 庫,即使啟用了橋接器)...

我也嘗試刪除我的 Pods 文件夾並進行全新安裝,但不幸的是,這不起作用。

對於對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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM