6

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```
Jake
  • 260
  • 1
  • 3
  • 10
  • Try following two options. 01) Build the app with legacy mode (File > Workspace Settings > Build System > Legacy Build System). 02) Remove all the pods, do a fresh pod install – fernando Jul 25 '20 at 00:35
  • My answer at the below link might be helpful for some - https://stackoverflow.com/a/68786521/6512858 – Kumar Gaurav Aug 17 '21 at 13:51

3 Answers3

7

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.

Jake
  • 260
  • 1
  • 3
  • 10
  • Hi there! Could you tell me how I can remove the file from my pod targets? I am not really used to xCode. – Walter Monecke Aug 20 '20 at 10:17
  • Sorry I just saw this, not sure if you still have this issue. What I did was in the file directory in Xcode click on "Pods" and there will be a list under "Targets" and find the pod you're looking for. – Jake Sep 08 '20 at 17:21
4

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
ronkot
  • 5,915
  • 4
  • 27
  • 41
Walter Monecke
  • 2,386
  • 1
  • 19
  • 52
2

EDIT : I fixed the build issue by removing ONLY React-Core.common-AccessibilityResources from the targets using my Podfile.

(I wanted to reply to Jake's answer, but I don't have enough reputation to comment yet)

I have tried modifying my Podfile to exclude these two targets (React-Core.common-AccessibilityResources and React-Core.common-CoreModulesHeaders-AccessibilityResources) from the Pods project. It starts compiling but it still ends up failing saying that AccessibilityResources.bundle does not exist.

While switching to the Legacy Build system (in workspace settings) seems to fix the AccessibilityResources issue, other issues arise (mainly about Swift libraries, even if the bridge is enabled)...

I've also tried to delete my Pods folder and do a clean install, but unfortunately, this did not work.

BSoD
  • 151
  • 6
  • Hi there! Could you tell me how to do this? I am not very experienced with xCode and don't want to mess my project by deleting something else. – Walter Monecke Aug 20 '20 at 10:20