无法在 Mac M1 中存档 ReactNative 项目 [英] Unable to Archive ReactNative project in Mac M1
问题描述
当我尝试存档时,出现以下错误 -
When I try to Archive, I get the following error -
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.
If I remove React-Core.common-AccessibilityResources
from Pods, the share extension doesn't build stating that it needs this Pod.
我正在使用的堆栈 -
RN - 0.64.2
React - 17.0.1
Node - 14.17.3
npm - 7.5.0
Xcode - 12.5.1
Macbook Air M1
推荐答案
我发现,我的共享扩展的 ReactNative 配置与主应用程序不同,后者导入了两次依赖项.
I figured out, that I was having a different configuration of ReactNative for the share extension than the main app, which was importing the dependencies twice.
这是 PodFile 的一个片段
Here's a snippet from the PodFile
target 'project' do
...
use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => true
)
...
end
target 'shareExtension' do
...
use react_native!
...
end
对于共享扩展,我用这个替换了配置
For the share extension, I replaced the config with this
target 'shareExtesion' do
use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => true
)
...
end
在 Podfile
中进行此更改后,进行必要的清理,pod install
并且它工作正常.
After making this change in Podfile
, do necessary cleanups, pod install
and it worked fine.
这篇关于无法在 Mac M1 中存档 ReactNative 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!