欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Xcode React-native Archive 报错 Multiple commands produce...IntermediateBuildFilesPath/UninstalledProd

程序员文章站 2022-05-29 20:27:32
...

 

 

Xcode React-native 运行一切正常,Archive时报错.

 

Multiple commands produce '/Users/*******/Library/Developer/Xcode/DerivedData/*******-dwdonbnvuqjattffwatyikzwovln/Build/Intermediates.noindex/ArchiveIntermediates/*******/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libReact.a':

1) Target 'React' has a command with output '/Users/*******/Library/Developer/Xcode/DerivedData/*******-dwdonbnvuqjattffwatyikzwovln/Build/Intermediates.noindex/ArchiveIntermediates/*******/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libReact.a'

2) Target 'React' has a command with output '/Users/*******/Library/Developer/Xcode/DerivedData/*******-dwdonbnvuqjattffwatyikzwovln/Build/Intermediates.noindex/ArchiveIntermediates/*******/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libReact.a'

Xcode React-native Archive 报错 Multiple commands produce...IntermediateBuildFilesPath/UninstalledProd

参考网上的一些方法:

方法1.

Cocoapods下的第三方库libReact.a多个路径

 

:-1: Multiple commands produce '/Users/***/Library/Developer/Xcode/DerivedData/sentryCpush-cvpqbragxhlzloeebvyoihyauasl/Build/Intermediates.noindex/ArchiveIntermediates/sentryCpush/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libReact.a':
1) Target 'React' has a command with output '/Users/***/Library/Developer/Xcode/DerivedData/sentryCpush-cvpqbragxhlzloeebvyoihyauasl/Build/Intermediates.noindex/ArchiveIntermediates/sentryCpush/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libReact.a'
2) Target 'React' has a command with output '/Users/***/Library/Developer/Xcode/DerivedData/sentryCpush-cvpqbragxhlzloeebvyoihyauasl/Build/Intermediates.noindex/ArchiveIntermediates/sentryCpush/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libReact.a'
  • 解决方式
    在Podfile中添加:

 

post_install do |installer|
  installer.pods_project.targets.each do |target|
    
    # The following is needed to ensure the "archive" step works in XCode.
    # It removes React & Yoga from the Pods project, as it is already included in the main project.
    # Without this, you'd see errors when you archive like:
    # "Multiple commands produce ... libReact.a"
    # "Multiple commands produce ... libyoga.a"
    
    targets_to_ignore = %w(React yoga)
    
    if targets_to_ignore.include? target.name
      target.remove_from_project
    end
    
  end
end

方法1 未能解决报错。

原文链接:http://www.manongjc.com/detail/18-xdqnspoedefhryu.html

方法2. 

不使用New Build System,在File > Project/Workspace Settings中的Share Project/Workspace Settings 里build system 将New Build System(Default)切换成Legacy build system。

方法2未能解决报错。
原文链接:https://www.jianshu.com/p/fdb1421f3c8b

 

解决方法:

Xcode React-native Archive 报错 Multiple commands produce...IntermediateBuildFilesPath/UninstalledProd

删除pods targets中 提示报错的 react yoga。

搞定。

另外应用市场会禁止使用webview 所以还需删除:

Xcode React-native Archive 报错 Multiple commands produce...IntermediateBuildFilesPath/UninstalledProd

目录下的:

Xcode React-native Archive 报错 Multiple commands produce...IntermediateBuildFilesPath/UninstalledProd

这4个文件

相关标签: react native iOS