react-native icon indicating copy to clipboard operation
react-native copied to clipboard

iOS unable to archive [RN 0.63.2] - Target 'React-Core.common-AccessibilityResources' has create directory command with output

Open wmonecke opened this issue 4 years ago • 45 comments

Description

I am unable to archive the project for release.

React Native version:

System:
    OS: macOS 10.15.3
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 5.95 GB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 8.9.4 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.9.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.8.4 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 23, 25, 26, 27, 28, 29
      Build Tools: 26.0.2, 26.0.3, 27.0.2, 27.0.3, 28.0.2, 28.0.3, 29.0.2
      System Images: android-28 | Google Play Intel x86 Atom, android-P | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: 11.5/11E608c - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_172 - /usr/bin/javac
    Python: 2.7.14 - /usr/local/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.2 => 0.63.2 
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

Archive a RN project at 0.63.2 with new build system in xCode 11.5 after upgrading from RN 0.61.x or lower.

Error encountered:

Multiple commands produce '/Users/.../Library/Developer/Xcode/DerivedData/...-ajoyscixyrdigdfuscjixbqjltzi/Build/Intermediates.noindex/ArchiveIntermediates/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle':

1) Target 'React-Core.common-AccessibilityResources' has create directory command with output '/Users/.../Library/Developer/Xcode/DerivedData/...-ajoyscixyrdigdfuscjixbqjltzi/Build/Intermediates.noindex/ArchiveIntermediates/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'

2) Target 'React-Core.common-CoreModulesHeaders-AccessibilityResources' has create directory command with output '/Users/.../Library/Developer/Xcode/DerivedData/...-ajoyscixyrdigdfuscjixbqjltzi/Build/Intermediates.noindex/ArchiveIntermediates/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'

Current Workaround:

Remove target in your Podfile. It should look something like this (react-native 0.63.2): Note: ONLY remove React-Core.common-AccessibilityResources

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)

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

wmonecke avatar Aug 20 '20 10:08 wmonecke

Try: $ pod deintegrate $ pod install

Conrador avatar Aug 20 '20 20:08 Conrador

Try: $ pod deintegrate $ pod install

No this didn't work, I already tried it.

wmonecke avatar Aug 20 '20 21:08 wmonecke

We started experiencing the same problem when React Native version in the project was upgraded to 0.63.2. Switching Xcode build system to legacy solved the problem, but it is rather a workaround than a solution.

kahakai avatar Aug 22 '20 15:08 kahakai

Also seeing the same issue.

https://github.com/react-native-community/upgrade-support/issues/100

sgup avatar Aug 24 '20 18:08 sgup

I had a couple of days attending this problem but I'm still getting same error or related error after testing different "solutions"

My project contains a Notification Extension and I'm getting this issue but instead to have it related with main target, i have the related with the extension.

Following Current Workaround provided on issue description, I'm getting this error on my Notification Extension:

error: Resource "/Users/angeeeld/Library/Developer/Xcode/DerivedData/..../BuildProductsPath/Release-iphoneos/React-Core.common/AccessibilityResources.bundle" not found. Run 'pod install' to update the copy resources script.

Any idea how to address the issue?

Meanwhile, I will continue on my research, if I found something, I won't hesitate on let you know.

AngeeelD avatar Aug 24 '20 21:08 AngeeelD

same

Fl0p avatar Aug 26 '20 08:08 Fl0p

Check your Podfiles. When you enter Build Phases -> Copy Pods Resources You should have(React-Core, not React-Core.common): Screenshot 2020-08-26 at 10 29 58

I also have Permissions Notification pod added above config, use_react_native!: Screenshot 2020-08-26 at 10 33 11

Conrador avatar Aug 26 '20 08:08 Conrador

  1. Open your xCode
  2. select pod folder
  3. find or search React-Core.common-AccessibilityResources
  4. Remove it from pod Screenshot 2020-08-30 at 2 23 23 PM

5 rebuild your project

heritvithalani19 avatar Aug 30 '20 09:08 heritvithalani19

I had a couple of days attending this problem but I'm still getting same error or related error after testing different "solutions"

My project contains a Notification Extension and I'm getting this issue but instead to have it related with main target, i have the related with the extension.

Following Current Workaround provided on issue description, I'm getting this error on my Notification Extension:

error: Resource "/Users/angeeeld/Library/Developer/Xcode/DerivedData/..../BuildProductsPath/Release-iphoneos/React-Core.common/AccessibilityResources.bundle" not found. Run 'pod install' to update the copy resources script.

Any idea how to address the issue?

Meanwhile, I will continue on my research, if I found something, I won't hesitate on let you know.

@AngeeelD After trying all night, I found out that my Podfile has following OneSignal target:

target 'OneSignalNotificationServiceExtension' do
  pod 'react-native-onesignal', :path => '../node_modules/react-native-onesignal'
end

According to the latest OneSingal setup guide, pod config should modify like following:

target 'OneSignalNotificationServiceExtension' do
  pod 'OneSignal', '>= 2.9.3', '< 3.0'
end

and run pod install.

After doing above actions, My app worked well for archiving.

tp26610 avatar Sep 19 '20 07:09 tp26610

one solution if you use multiple targets, you need use use_react_native! at all targets, so the pod won't generate duplicate targets.

react native 0.63 add one target "AccessibilityResources" which run copy bundle resources if duplicate targets, the errors occurs.

before

  target 'xxxx' do
     use_react_native!
  end

target 'FCMDevNotificationServiceExtension' do
  pod 'RNXXXLib', :path => '../node_modules/react-native-xxx-lib' 
end

[ Screen Shot 2020-09-22 at 2 44 32 PM

](url)

after

  target 'xxxx' do
     use_react_native!
  end


target 'FCMDevNotificationServiceExtension' do
  use_react_native!  <- add this line
  pod 'RNXXXLib', :path => '../node_modules/react-native-xxx-lib' 
end

Screen Shot 2020-09-22 at 2 46 31 PM

sbin1211 avatar Sep 22 '20 06:09 sbin1211

Hi, I'm facing the same issue since some days. The workarounds didn't work for me.

I am unable to archive the project for release:

error: Resource "/Users/cedricjung/Library/Developer/Xcode/DerivedData/decouverto-asvavlxsbksyvhgovxmjpnlracmz/Build/Intermediates.noindex/ArchiveIntermediates/decouverto/BuildProductsPath/Release-iphoneos/React-Core/AccessibilityResources.bundle" not found. Run 'pod install' to update the copy resources script.

You can check all source code there. I'm using react-native v0.63.3.

I'm new in iOS development even if I use react-native since 3 years.

Thank you for your help. :)

cedced19 avatar Nov 03 '20 22:11 cedced19

Thank you @sbin1211 !

your solution helped - I didn't pay attention to the tvOS target I had in the Podfile. Build succeeded after adding use_react_native! there.

hbarylskyi avatar Nov 23 '20 06:11 hbarylskyi

Hi, I wanted to know where you find "React-Core.common-AccessibilityResources", I think I don't have this one that's why I have this error: error: Resource "/Users/cedricjung/Library/Developer/Xcode/DerivedData/decouverto-asvavlxsbksyvhgovxmjpnlracmz/Build/Intermediates.noindex/ArchiveIntermediates/decouverto/BuildProductsPath/Release-iphoneos/React-Core/AccessibilityResources.bundle" not found. Run 'pod install' to update the copy resources script.

Screen Shot 2020-09-22 at 2 46 31 PM

@sbin1211 how to you access to this menu ?

I had a couple of days attending this problem but I'm still getting same error or related error after testing different "solutions"

My project contains a Notification Extension and I'm getting this issue but instead to have it related with main target, i have the related with the extension.

Following Current Workaround provided on issue description, I'm getting this error on my Notification Extension:

error: Resource "/Users/angeeeld/Library/Developer/Xcode/DerivedData/..../BuildProductsPath/Release-iphoneos/React-Core.common/AccessibilityResources.bundle" not found. Run 'pod install' to update the copy resources script.

Any idea how to address the issue?

Meanwhile, I will continue on my research, if I found something, I won't hesitate on let you know.

@AngeeelD did you found any answer ? @tp26610 's answer is not possible for me as I do not use OneSignal. Thank you all !

cedced19 avatar Nov 29 '20 10:11 cedced19

Hi, I wanted to know where you find "React-Core.common-AccessibilityResources", I think I don't have this one that's why I have this error: error: Resource "/Users/cedricjung/Library/Developer/Xcode/DerivedData/decouverto-asvavlxsbksyvhgovxmjpnlracmz/Build/Intermediates.noindex/ArchiveIntermediates/decouverto/BuildProductsPath/Release-iphoneos/React-Core/AccessibilityResources.bundle" not found. Run 'pod install' to update the copy resources script.

Screen Shot 2020-09-22 at 2 46 31 PM

@sbin1211 how to you access to this menu ?

I had a couple of days attending this problem but I'm still getting same error or related error after testing different "solutions" My project contains a Notification Extension and I'm getting this issue but instead to have it related with main target, i have the related with the extension. Following Current Workaround provided on issue description, I'm getting this error on my Notification Extension: error: Resource "/Users/angeeeld/Library/Developer/Xcode/DerivedData/..../BuildProductsPath/Release-iphoneos/React-Core.common/AccessibilityResources.bundle" not found. Run 'pod install' to update the copy resources script. Any idea how to address the issue? Meanwhile, I will continue on my research, if I found something, I won't hesitate on let you know.

@AngeeelD did you found any answer ? @tp26610 's answer is not possible for me as I do not use OneSignal. Thank you all !

Also experiencing the same issue, after following the recommended solutions above. I've lost 4 hours, and the archive process continues to fail on what appears to be the final steps due to this same error.

Also tried looking for all other React-Core.common throughout the project files, and the only other one is in reference to the headers. I tried removing that one, just in case it fixed the issue, but not such luck. Something still seems to be referencing React-Core.common, but I can't find what it is.

EDIT: It may just be my specific use case, but I realized I'd forgot to correctly update the podfile. The upgrade helper at https://react-native-community.github.io/upgrade-helper/?from=0.62.2&to=0.63.3 makes some notable changes to the podfile, primarily stripping out a lot of the individual packages, and replacing it with 2-3 lines of code.

After changing this, I managed to successfully archive my project (though I now have a somewhat related issue with RCTUserDefaults, though that's out of the scope of this ticket).

ChronSyn avatar Nov 29 '20 18:11 ChronSyn

Unfortunately I had to downgrade to 0.62.2 in order to archive. I might look forward to what changed from 0.62 to 0.63.

cedced19 avatar Nov 30 '20 21:11 cedced19

Hi, I wanted to know where you find "React-Core.common-AccessibilityResources", I think I don't have this one that's why I have this error: error: Resource "/Users/cedricjung/Library/Developer/Xcode/DerivedData/decouverto-asvavlxsbksyvhgovxmjpnlracmz/Build/Intermediates.noindex/ArchiveIntermediates/decouverto/BuildProductsPath/Release-iphoneos/React-Core/AccessibilityResources.bundle" not found. Run 'pod install' to update the copy resources script.

Screen Shot 2020-09-22 at 2 46 31 PM

@sbin1211 how to you access to this menu ?

I had a couple of days attending this problem but I'm still getting same error or related error after testing different "solutions" My project contains a Notification Extension and I'm getting this issue but instead to have it related with main target, i have the related with the extension. Following Current Workaround provided on issue description, I'm getting this error on my Notification Extension: error: Resource "/Users/angeeeld/Library/Developer/Xcode/DerivedData/..../BuildProductsPath/Release-iphoneos/React-Core.common/AccessibilityResources.bundle" not found. Run 'pod install' to update the copy resources script. Any idea how to address the issue? Meanwhile, I will continue on my research, if I found something, I won't hesitate on let you know.

@AngeeelD did you found any answer ? @tp26610 's answer is not possible for me as I do not use OneSignal. Thank you all !

when you open the pod project, you will find it at Screen Shot 2020-12-02 at 9 30 07 PM

check your podfile, if you have multiple targets at your podfile, try to add this line at every target use_react_native!

sbin1211 avatar Dec 02 '20 13:12 sbin1211

Thank you but this didn't changed anything.

cedced19 avatar Dec 02 '20 15:12 cedced19

Description

I am unable to archive the project for release.

React Native version:

System:
    OS: macOS 10.15.3
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 5.95 GB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 8.9.4 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.9.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.8.4 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 23, 25, 26, 27, 28, 29
      Build Tools: 26.0.2, 26.0.3, 27.0.2, 27.0.3, 28.0.2, 28.0.3, 29.0.2
      System Images: android-28 | Google Play Intel x86 Atom, android-P | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: 11.5/11E608c - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_172 - /usr/bin/javac
    Python: 2.7.14 - /usr/local/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.2 => 0.63.2 
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

Archive a RN project at 0.63.2 with new build system in xCode 11.5 after upgrading from RN 0.61.x or lower.

Error encountered:

Multiple commands produce '/Users/.../Library/Developer/Xcode/DerivedData/...-ajoyscixyrdigdfuscjixbqjltzi/Build/Intermediates.noindex/ArchiveIntermediates/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle':

1) Target 'React-Core.common-AccessibilityResources' has create directory command with output '/Users/.../Library/Developer/Xcode/DerivedData/...-ajoyscixyrdigdfuscjixbqjltzi/Build/Intermediates.noindex/ArchiveIntermediates/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'

2) Target 'React-Core.common-CoreModulesHeaders-AccessibilityResources' has create directory command with output '/Users/.../Library/Developer/Xcode/DerivedData/...-ajoyscixyrdigdfuscjixbqjltzi/Build/Intermediates.noindex/ArchiveIntermediates/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'

Current Workaround:

Remove target in your Podfile. It should look something like this (react-native 0.63.2): Note: ONLY remove React-Core.common-AccessibilityResources

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)

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

If it not works for you, then try doing: -> pod cache clean --all -> pod update. Thats clears up things for me and helped to work.

yugi03 avatar Jan 10 '21 19:01 yugi03

In my case I had another notification service target and replacing use_native_modules! with

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

and then pod install solved the issue

murat-mehmet avatar Jan 14 '21 11:01 murat-mehmet

Any update on this issue from official support?

Thanks for all the explanation above, I am able to remove "React-Core.common-AccessibilityResources" manually, but it will be better if this package is officially resolve.

FlashLim avatar Mar 16 '21 13:03 FlashLim

Same issue. Deleted from .xcworkspace

designervoid avatar Mar 28 '21 22:03 designervoid

I faced the same issue when doing Product -> Archive:

Multiple commands produce '.../AccessibilityResources.bundle'

I tried to remove pods related to AccessibilityResources. But then I get this problem:

error: Resource ".../AccessibilityResources.bundle" not found. Run 'pod install' to update the copy resources script.

and running 'pod install' just restores deleted pods back.


I managed to fix the issue by moving reference to react-native-permissions package inside target block in 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, '10.0'
 
-permissions_path = '../node_modules/react-native-permissions/ios'
-pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
 
 target 'my_app' do
   config = use_native_modules!
   use_react_native!(:path => config["reactNativePath"])
 
+  permissions_path = '../node_modules/react-native-permissions/ios'
+  pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
 end

and now Archive completes successfully!

PiN73 avatar Jun 07 '21 22:06 PiN73

@PiN73 that worked for me too! thanks

rizwanatta avatar Aug 26 '21 11:08 rizwanatta

None of the solutions above worked for me, but what eventually solved the problem was:

If you are using react-native-maps make sure your Podfile has the same imports as here in react-native-maps example project. In my case I had some redundant Google maps imports which were needed in some older maps library version. Also make sure the pod imports are inside targets.

raulgordejev avatar Sep 02 '21 10:09 raulgordejev

I had to revert to older version 0.27.1 to get things working will try this though later on

rizwanatta avatar Sep 02 '21 10:09 rizwanatta

I faced the same issue when doing Product -> Archive:

Multiple commands produce '.../AccessibilityResources.bundle'

I tried to remove pods related to AccessibilityResources. But then I get this problem:

error: Resource ".../AccessibilityResources.bundle" not found. Run 'pod install' to update the copy resources script.

and running 'pod install' just restores deleted pods back.

I managed to fix the issue by moving reference to react-native-permissions package inside target block in 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, '10.0'
 
-permissions_path = '../node_modules/react-native-permissions/ios'
-pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
 
 target 'my_app' do
   config = use_native_modules!
   use_react_native!(:path => config["reactNativePath"])
 
+  permissions_path = '../node_modules/react-native-permissions/ios'
+  pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
 end

and now Archive completes successfully!

Had this issue on new Mac with M1 and react-native 0.64.0. I had to use combination of moving these two lines and adding use_react_native! under all targets.

vishalmullur18 avatar Oct 01 '21 11:10 vishalmullur18

having the same issue on RN 0.66.3. Tried some solutions here and none works. Here is the error when archiving:

Showing All Messages
Multiple commands produce '/Users/macair/Library/Developer/Xcode/DerivedData/xyz_app5-ccwmlzzkerrlyxhiznjzjqpzwjdu/Build/Intermediates.noindex/ArchiveIntermediates/xyz_app5/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle':
1) Target 'React-Core.common-AccessibilityResources' has create directory command with output '/Users/macair/Library/Developer/Xcode/DerivedData/xyz_app5-ccwmlzzkerrlyxhiznjzjqpzwjdu/Build/Intermediates.noindex/ArchiveIntermediates/xyz_app5/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'
2) Target 'React-Core.common-CoreModulesHeaders-AccessibilityResources' has create directory command with output '/Users/macair/Library/Developer/Xcode/DerivedData/xyz_app5-ccwmlzzkerrlyxhiznjzjqpzwjdu/Build/Intermediates.noindex/ArchiveIntermediates/xyz_app5/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'

emclab avatar Dec 18 '21 04:12 emclab

I still have the same issue, the current workaround with Flipper produces other problems. Pls help

markosrx avatar Jan 12 '22 15:01 markosrx

Afted adding use_react_native! config to Podfile, archive build succeed.

target ‘x target’ do 
  use_react_native!:
  …
end

tarkcelk avatar Jan 14 '22 20:01 tarkcelk

I still have the same issue, the current workaround with Flipper produces other problems. Pls help

Have you found a solution?

julianxlozano avatar Jan 17 '22 18:01 julianxlozano