Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix React Native App not building for iOS

I'm having trouble building my react native app for iOS. For android it builds perfectly fine. For iOS, the project will build but not archive. Here is the error code when attempting to archive my project:

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'

Few things to state: Running React-native 0.63, Podfile and deployment targets are all on 11

Edit: when running from the command line I receive this error

      '/Users/jacobcarpenter/Library/Developer/Xcode/DerivedData/LFGOPocker-bzowsupbiktzuzaaadvokqxbgvzq/Build/Intermediates.noindex/ArchiveIntermediates/LFGOPocker/BuildProductsPath/Release-iphoneos/YogaKit/YogaKit.modulemap'
      not found```
like image 555
Jake Avatar asked Dec 31 '22 23:12

Jake


2 Answers

I fixed this error by deleting 'React-Core.common-AccessibilityResources' from my pod targets. When attempting to archive, make sure you are not using .xcodeproj and using your workspace. Even if you think you are using workspace triple check. Also if you try archiving through the command line you must specifically state workspace.

like image 154
Jake Avatar answered Jan 05 '23 19:01

Jake


For anyone who is not very experienced with Pods, add the following lines to your 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
like image 38
Walter Monecke Avatar answered Jan 05 '23 17:01

Walter Monecke