多个命令在 Xcode 12 上生成并响应本机

Multiple commands produce on Xcode 12 and react native

我正在尝试为 ios 构建和存档应用程序。但我收到以下错误。我在 Whosebug 和 google 上进行了搜索,但我的错误有点不同,我无法理解。如果有人能帮助我那就太好了。

确切错误:

Multiple commands produce 
'/Users/sumantakundu/Library/Developer/Xcode/DerivedData/Globallove-emwwobuvdzgwhtbdhclymguzjmkg/Build/Intermediates.noindex/ArchiveIntermediates/Globallove/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle':
1) Target 'React-Core-60309c9c-AccessibilityResources' has create directory command with output '/Users/sumantakundu/Library/Developer/Xcode/DerivedData/Globallove-emwwobuvdzgwhtbdhclymguzjmkg/Build/Intermediates.noindex/ArchiveIntermediates/Globallove/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'
2) Target 'React-Core-AccessibilityResources' has create directory command with output '/Users/sumantakundu/Library/Developer/Xcode/DerivedData/Globallove-emwwobuvdzgwhtbdhclymguzjmkg/Build/Intermediates.noindex/ArchiveIntermediates/Globallove/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'

我使用的依赖项:

"dependencies": {
"@react-native-async-storage/async-storage": "^1.14.1",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-cookies/cookies": "^6.0.4",
"@react-navigation/drawer": "^5.12.3",
"@react-navigation/native": "^5.9.2",
"@react-navigation/stack": "^5.14.2",
"react": "16.13.1",
"react-native": "0.63.4",
"react-native-gesture-handler": "^1.9.0",
"react-native-image-slider-box": "^1.0.12",
"react-native-ionicons": "^4.6.5",
"react-native-paper": "^3.6.0",
"react-native-reanimated": "^1.13.2",
"react-native-safe-area-context": "^3.1.9",
"react-native-screens": "^2.17.1",
"react-native-tableview-simple": "^4.2.1",
"react-native-vector-icons": "^8.0.0",
"react-native-webview": "^11.2.1",
"rn-webview": "^0.1.0"

},

iOS Xcode 生成设置截图如下:

我的 POD 文件:

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

platform :ios, '10.0'

target 'Globallove' do
config = use_native_modules!

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

#target 'GloballoveTests' do
#inherit! :complete
# Pods for testing
#end

# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!({ 'Flipper' => '0.74.0' })
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

我也遇到了类似的问题,请尝试下面提到的说明来解决您的问题。可能对你有帮助。

从 Xcode Pods 文件夹中删除 React-Core.common-AccessibilityResources。 完成此代码后,在您的项目中执行 pod install 命令。 在构建之前还要清除派生数据

在我的例子中,它应该是 React-Core-AccessibilityResources 我用下面的代码更新了我的 pod 文件:

use_flipper!({ 'Flipper' => '0.74.0' })
 post_install do |installer|
  flipper_post_install(installer)

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

然后 运行 pod 安装

我在使用 react-native 0.64.1 时遇到了同样的问题,我通过将构建系统切换到 Legacy 设法解决了这个问题。

文件 > 工作区设置 > 构建系统 > 遗留构建系统

  1. 打开你的xCode
  2. select pod 文件夹
  3. 查找或搜索 React-Core.common-AccessibilityResources
  4. 从 pod 中删除它

最后重建你的项目。

多命令生成是 React Native 中的常见错误。主要是由于图标和字体。因此,要解决此问题,我们需要从 Xcode 中的副本资源包中删除项目。 Click to check image

第 1 步。打开 Xcode 步骤 2. 检查错误。您会发现错误计数与复制包资源中的字体计数相同。因此,请删除那里的字体和 运行 仅 Xcode 中的代码。

学习愉快。

错误只是说一些 Pods 是重复的,仔细检查所有 pods 并删除重复的 pods