繁体   English   中英

无法在 Mac M1 中存档 ReactNative 项目

[英]Unable to Archive ReactNative project in Mac M1

当我尝试存档时,出现以下错误 -

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

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

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

如果我从 Pod 中删除React-Core.common-AccessibilityResources ,共享扩展不会构建,说明它需要此 Pod。

我正在使用的堆栈 -

RN - 0.64.2
React - 17.0.1
Node - 14.17.3
npm - 7.5.0
Xcode - 12.5.1
Macbook Air M1

从 Podfile 中的目标中删除React-Core.common-AccessibilityResources Podfile了这个问题。

...
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
...

如果那没用试试这个:

我通过从 Pod 目标中删除“React-Core.common-AccessibilityResources”来修复此错误。 尝试存档时,请确保您没有使用 .xcodeproj 并使用您的工作区。 即使您认为您正在使用工作区三重检查。 此外,如果您尝试通过命令行归档,您必须特别指定 state 工作区。

致谢: 如何修复 React Native App 不是为 iOS 构建的

Xcode 12 错误:多个命令生成 AccessibilityResources.bundle

我想通了,我对共享扩展的 ReactNative 配置与主应用程序不同,主应用程序导入了两次依赖项。

这是 PodFile 的一个片段

target 'project' do 
  ...
  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => true
  )

  ...
end

target 'shareExtension' do
  ...
  use react_native!
  ...
end

对于共享扩展,我用这个替换了配置

target 'shareExtesion' do
  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => true
  )

  ...
end

Podfile中进行此更改后,进行必要的清理、 pod install ,它运行良好。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM