XCode Log

奇怪的是,如果我无法在没有发布错误的情况下复制XCode,那么我就无法成功地构建版本.该项目也在设备上正确构建.

我已经搜索了这个主题,并try 禁用可测试性,并将项目设置中的"No Common Blocks"设置为No,但到目前为止运气不佳.

该项目是一个基于React Native 0.40的项目,还安装了CocoaPods.这是什么

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

非常感谢您的帮助或见解,我在这方面已经坚持了好几个小时.

推荐答案

在另一个react native project here上找到相关问题后,最终解决了问题.

答案是,Xcode项目中有两个React Native副本,一个来自CocoaPods,另一个作为子项目.只需删除Podfile中Libraries inside Xcode下已经声明的所有模块,在清理并重试后,错误就会消失.

这个问题的有趣之处在于,调试和发布中的所有构建都可以工作,但在try 归档项目以供分发时失败.

[2017年5月2日更新]

我上面描述的解决方案在使用react-native run-ios/android运行代码时可能会导致调试时错误,尽管它允许成功地归档项目.

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

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

React-native相关问答推荐

如何更改分隔底部标签和屏幕内容的线的 colored颜色 ?React Native Tab导航器

react-native-fs 改变 toUrl 本身

按下按钮有一个borderRadius

无法在 React Native iOS 模拟器中按 URI 显示图像

ReactNative 0.43-rc.2 FlatList -- 试图获取超出范围索引 0 的框架

React Navigation 5 隐藏Drawer抽屉元素

用hooks钩子react context上下文防止重新渲染

异步(async)/等待(await)和递归

如何在 React Native For Android 中删除启动画面后的白屏

React native Refresh 有效,但下一次调用仍使用最后一个令牌

textAlignVertical不是有效的样式属性

Yarn 在哪里存储离线包?

由于端口 8081 sunproxyadmin,无法打包 react native

错误:无法解析模块`buffer`

react-native android应用程序中的underlineColorAndroid is not a valid style property错误

在 react-native 和 firebase 3.1 中登录 Facebook

将 react-native 元素Bundle 为 iOS 框架或 (.aar) Android 库

带有父 PanResponder 的 TouchableOpacity

如何在 React 中将函数与钩子绑定?

React Native:无法解析模块 fs