React Native XCode项目产品存档失败,具有架构arm64的重复符号 [英] React Native XCode Project Product Archive Fails with duplicate symbols for architecture arm64

查看:116
本文介绍了React Native XCode项目产品存档失败,具有架构arm64的重复符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

奇怪的是,我似乎无法使存档在XCode中工作,但构建成功但没有重复错误符号,如果我不尝试存档,但只是建立一个发布版本。该项目也在设备上正确构建。

Strangely, I can't seem to get Archive to work in XCode but the build succeeds without the errors on duplicate symbols if I do not attempt to Archive but simply build a release version. The project builds properly on devices as well.

我已经搜索了这个主题并试图禁用可测试性,并将项目设置中的No Common Blocks设置为NO到目前为止还没有运气。

I have searched up on this topic and tried disabling testability, and setting the 'No Common Blocks' in the project settings to NO as well but no luck so far.

该项目是一个基于React Native 0.40的项目,同时安装了CocoaPods。 PodFile就是这个

The Project is a React Native 0.40 based project with CocoaPods installed as well. PodFile is this

# You Podfile should look similar to this file. React Native currently does not support use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.0'

# Change 'AirMapsExplorer' to match the target in your Xcode project.
target 'StreetSmart' do
  pod 'React', path: '../node_modules/react-native', :subspecs => [
    'Core',
    'RCTActionSheet',
    'RCTAnimation',
    'RCTGeolocation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTNetwork',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket'
  ]

  pod 'GoogleMaps'  # <~~ remove this line if you do not want to support GoogleMaps on iOS

# when not using frameworks  we can do this instead of including the source files in our project (1/4):
#  pod 'react-native-maps', path: '../../'
#  pod 'react-native-google-maps', path: '../../'  # <~~ if you need GoogleMaps support on iOS
end

XCode版本是8.2.1,项目文件是通过.xcworkspace打开的,因为安装了pod。

XCode Version is 8.2.1, and the project file is opened via .xcworkspace since pods are installed.

非常感谢对此的任何帮助或见解,已经坚持了几个小时。

Would really appreciate any help or insight on this, been stuck at this for hours.

推荐答案

最后在另一个本机项目上找到相关问题后解决了问题这里

Finally solved the problem after finding a relevant issue on another react-native project here.

答案是Xcode项目中有两个React Native副本,一个来自CocoaPods,另一个来自子项目。只需删除已在Xcode中的 Libraries 下的Podfile中声明的所有模块,并在干净并重新尝试后错误消失。

The answer is that there is two copies of React Native in the Xcode project, one from CocoaPods and another as a subproject. Just remove all modules that were already declared in Podfile under the Libraries inside Xcode and the error goes away after a clean and re-try.

这个问题的有趣之处在于Debug和Release中的所有版本都有效但在尝试归档项目以进行分发时失败。

What's interesting about this issue is that all builds in Debug and Release works but it fails when attempting to Archive the project for distribution.

[更新2 2017年5月]

[Update 2 May 2017]

当您使用 react-native run-ios / android <运行代码时,上面描述的解决方案可能会导致调试时错误/ code>虽然它允许项目成功存档。

The solution I described above can cause debug-time errors when you run your code with react-native run-ios/android though it allows the project to be successfully archived.

另一种方法是删除中存在的那些重复模块来自 Podfile 声明的库 Podfile 而不是文件夹。当然,运行相关的pod命令,清理你的项目等。

An alternative method is to remove those duplicate modules that exist both in Libraries and Podfile from the Podfile declaration instead of the Libraries folder. And of course run the relevant pod commands, clean your project etc.

这样做可以让我的代码存档,也可以在没有调试时错误的情况下运行

Doing this allowed my code to archive and also run without debug-time errors

这篇关于React Native XCode项目产品存档失败,具有架构arm64的重复符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆