ios - react native iOS 归档失败

标签 ios react-native archive

最近遇到这个错误,在调试中构建工作正常。链接似乎是失败的地方:

Undefined symbols for architecture armv7:
  "facebook::react::parseTypeFromHeader(facebook::react::BundleHeader const&)", referenced from:
      +[RCTJavaScriptLoader attemptSynchronousLoadOfBundleAtURL:runtimeBCVersion:sourceLength:error:] in libReact.a(RCTJavaScriptLoader.o)
  "_JSNoBytecodeFileFormatVersion", referenced from:
      +[RCTJavaScriptLoader loadBundleAtURL:onProgress:onComplete:] in libReact.a(RCTJavaScriptLoader.o)
      +[RCTJavaScriptLoader attemptSynchronousLoadOfBundleAtURL:runtimeBCVersion:sourceLength:error:] in libReact.a(RCTJavaScriptLoader.o)
  "_OBJC_CLASS_$_RCTCxxBridge", referenced from:
      objc-class-ref in libReact.a(RCTBridge.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我的图书馆:

iOS Build Phases Libraries

我的 pod :

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'BonggaKaDay' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for BonggaKaDay

  pod 'Firebase/Core', '~> 5.7.0'
  pod 'Firebase/Functions', '~> 5.7.0'
  pod 'Firebase/Auth', '~> 5.7.0'
  pod 'Firebase/Firestore', '~> 5.7.0'
  pod 'Firebase/Messaging', '~> 5.7.0'
  pod 'Firebase/AdMob', '~> 5.7.0'
  pod 'FBAudienceNetwork'
  pod 'RNSVG', :path => '../node_modules/react-native-svg'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
        'RCTImage' # <-- Add RCTImage
    ]
  pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
end

我不太确定错误在哪里。请帮忙。

最佳答案

将此添加到您的播客文件中:

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

谢谢@Takitaha

关于ios - react native iOS 归档失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53545248/

相关文章:

html - 为什么 iOS 上电话号码的字体颜色是蓝色?

ios - 关于在 Swift 中采用 Objective-C 协议(protocol)的困惑

ios - 如何下载 Firebase 存储文件

Android java.lang.UnsatisfiedLinkError : couldn't find DSO to load

react-native - 在 React Native 中如何在 session 中存储值?

ios - 将应用程序提交到应用程序商店时缺少应用程序版本

IOS - 应用内购买恢复完成的交易

react-native - Gradle 升级后 Android 的 React Native 构建错误

ios - 将 CLLocation 数组保存到存档 ios

ios - Xcode 8 App Archive 验证失败并出现错误