微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Xcode发行版本问题未定义符号:_OBJC_CLASS _ $ _ FIRAuth

如何解决Xcode发行版本问题未定义符号:_OBJC_CLASS _ $ _ FIRAuth

尝试构建Xcode项目时遇到问题。

项目:该项目是一个解决方案,它可以在本机的package.json中进行响应。

{
  "name": "test","version": "0.0.1","private": true,"scripts": {
    "android": "ENVFILE=.env.dev react-native run-android --variant=debug","android-prod": "ENVFILE=.env.prod react-native run-android --variant=release","android-prod-debug": "ENVFILE=.env.prod react-native run-android --variant=debug","android-dev-local": "ENVFILE=.env.local.dev react-native run-android --variant=debug","ios": "react-native run-ios","start": "react-native start --reset-cache","metro": "DEBUG=* & react-native start","test": "jest","lint": "eslint . --ext .js,.jsx,.ts,.tsx","rn-link": "react-native link"
  },"dependencies": {
    "@invertase/react-native-apple-authentication": "^1.1.2","@react-native-community/async-storage": "^1.9.0","@react-native-community/cli-debugger-ui": "^4.8.0","@react-native-community/datetimepicker": "^2.5.0","@react-native-community/google-signin": "^4.0.3","@react-native-community/masked-view": "^0.1.10","@react-native-community/toolbar-android": "^0.1.0-rc.2","@react-native-firebase/analytics": "^7.0.1","@react-native-firebase/app": "7.0.1","@react-native-firebase/auth": "7.0.1","@react-native-firebase/crashlytics": "7.0.1","@react-native-firebase/iid": "^7.0.1","@react-native-firebase/messaging": "^7.0.1","@react-native-firebase/storage": "7.0.1","@react-navigation/drawer": "^5.7.7","@react-navigation/material-top-tabs": "^5.2.8","@react-navigation/native": "^5.2.3","@react-navigation/stack": "^5.2.18","@types/history": "^4.7.5","@types/moment": "^2.13.0","@types/numeral": "^0.0.27","@types/ramda": "^0.27.4","@types/react-native-fbsdk": "^1.1.0","@types/react-native-vector-icons": "^6.4.5","@types/react-native-video": "^5.0.1","@types/react-redux": "^7.1.7","@types/recompose": "^0.30.7","axios": "^0.19.2","date-fns": "^2.14.0","history": "^4.10.1","i18next": "^19.4.4","jetifier": "^1.6.5","moment": "^2.27.0","native-base": "2.13.12","numeral": "^2.0.6","ramda": "^0.27.0","react": "16.11.0","react-i18next": "^11.4.0","react-native": "0.62.2","react-native-config": "^1.0.0","react-native-device-info": "^5.5.6","react-native-fbsdk": "^2.0.0","react-native-gesture-handler": "^1.6.1","react-native-image-picker": "^2.3.2","react-native-modal": "^11.5.6","react-native-permissions": "^2.1.3","react-native-reanimated": "^1.8.0","react-native-responsive-screen": "^1.4.1","react-native-safe-area-context": "^0.7.3","react-native-screens": "^2.7.0","react-native-splash-screen": "^3.2.0","react-native-svg": "^12.1.0","react-native-swipe-list-view": "^3.1.2","react-native-tab-view": "^2.14.2","react-native-vector-icons": "6.6.0","react-native-video": "5.0.2","react-native-webview": "^10.8.3","react-native-youtube": "^2.0.1","react-redux": "^7.2.0","recompose": "^0.30.0","redux": "^4.0.5","redux-saga": "^1.1.3"
  },"devDependencies": {
    "@babel/core": "^7.6.2","@babel/runtime": "^7.6.2","@react-native-community/eslint-config": "^1.0.0","@types/jest": "^24.0.24","@types/react-native": "^0.62.0","@types/react-test-renderer": "16.9.2","@typescript-eslint/eslint-plugin": "^2.27.0","@typescript-eslint/parser": "^2.27.0","babel-jest": "^24.9.0","eslint": "^6.5.1","jest": "^24.9.0","metro-react-native-babel-preset": "^0.58.0","prettier": "^2.0.4","react-native-svg-transformer": "^0.14.3","react-test-renderer": "16.11.0","typescript": "^3.8.3"
  },"jest": {
    "preset": "react-native","modulefileExtensions": [
      "ts","tsx","js","jsx","json","node"
    ]
  }
}

以及我在Xcode中构建发行版时遇到的错误(在调试模式下可以正常运行)。

我遇到的错误是: enter image description here

显示所有错误

** 未定义的符号: OBJC_CLASS $ _ FIRAuth 未定义的符号: OBJC_CLASS $ _ FBSDKAppEvents 未定义的符号: OBJC_CLASS $ _ FBSDKApplicationDelegate **

我的pod文件

platform :ios,'9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

def add_flipper_pods!(versions = {})
  versions['Flipper'] ||= '~> 0.33.1'
  versions['DoubleConversion'] ||= '1.1.7'
  versions['Flipper-Folly'] ||= '~> 2.1'
  versions['Flipper-Glog'] ||= '0.3.6'
  versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
  versions['Flipper-RSocket'] ||= '~> 1.0'

  pod 'FlipperKit',versions['Flipper'],:configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutPlugin',:configuration => 'Debug'
  pod 'FlipperKit/SKIOSNetworkPlugin',:configuration => 'Debug'
  pod 'FlipperKit/FlipperKitUserDefaultsPlugin',:configuration => 'Debug'
  pod 'FlipperKit/FlipperKitReactPlugin',:configuration => 'Debug'

  # List all transitive dependencies for FlipperKit pods
  # to avoid them being linked in Release builds
  pod 'Flipper',:configuration => 'Debug'
  pod 'Flipper-DoubleConversion',versions['DoubleConversion'],:configuration => 'Debug'
  pod 'Flipper-Folly',versions['Flipper-Folly'],:configuration => 'Debug'
  pod 'Flipper-Glog',versions['Flipper-Glog'],:configuration => 'Debug'
  pod 'Flipper-PeerTalk',versions['Flipper-PeerTalk'],:configuration => 'Debug'
  pod 'Flipper-RSocket',versions['Flipper-RSocket'],:configuration => 'Debug'
  pod 'FlipperKit/Core',:configuration => 'Debug'
  pod 'FlipperKit/CppBridge',:configuration => 'Debug'
  pod 'FlipperKit/FBCxxFollyDynamicConvert',:configuration => 'Debug'
  pod 'FlipperKit/FBDefines',:configuration => 'Debug'
  pod 'FlipperKit/FKPortForwarding',:configuration => 'Debug'
  pod 'FlipperKit/FlipperKitHighlightOverlay',:configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutTextSearchable',:configuration => 'Debug'
  pod 'FlipperKit/FlipperKitNetworkPlugin',:configuration => 'Debug'
end

# Post Install processing for Flipper
def flipper_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'YogaKit'
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '4.1'
      end
    end
  end
end

target 'YourHouseWithAmalia' do
  # Pods for YourHouseWithAmalia
  permissions_path = '../node_modules/react-native-permissions/ios'
  
  pod 'FblazyVector',:path => "../node_modules/react-native/Libraries/FblazyVector"
  pod 'FBReactNativeSpec',:path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTrequired',:path => "../node_modules/react-native/Libraries/RCTrequired"
  pod 'RCTTypeSafety',:path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React',:path => '../node_modules/react-native/'
  pod 'React-Core',:path => '../node_modules/react-native/'
  pod 'React-CoreModules',:path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport',:path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet',:path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation',:path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob',:path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCtimage',:path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking',:path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork',:path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings',:path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText',:path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration',:path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket',:path => '../node_modules/react-native/'

  pod 'React-cxxreact',:path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi',:path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor',:path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector',:path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/callinvoker',:path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core',:path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga',:path => '../node_modules/react-native/ReactCommon/yoga',:modular_headers => true

  pod 'DoubleConversion',:podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog',:podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly',:podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  pod 'RNCAsyncStorage',:path => '../node_modules/@react-native-community/async-storage'
  pod 'RNDeviceInfo',:path => '../node_modules/react-native-device-info'
  pod 'RNPermissions',:path => '../node_modules/react-native-permissions'
  #pod 'Permission-Reminders',:path => "#{permissions_path}/Reminders.podspec"
  pod 'Permission-Notifications',:path => "#{permissions_path}/Notifications.podspec"
  pod 'RNFBMessaging',:path => '../node_modules/@react-native-firebase/messaging'
  pod 'RNFBIid',:path => '../node_modules/@react-native-firebase/iid'
  pod 'RNFBApp',:path => '../node_modules/@react-native-firebase/app'
  pod 'react-native-config',:path => '../node_modules/react-native-config'

  target 'YourHouseWithAmaliaTests' do
    inherit! :complete
    # Pods for testing
  end

  use_native_modules!

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled,Flipper will not work and
  # you should disable these next few lines.
  add_flipper_pods!
  post_install do |installer|
    flipper_post_install(installer)
  end
end

target 'YourHouseWithAmalia-tvOS' do
  # Pods for YourHouseWithAmalia-tvOS

  target 'YourHouseWithAmalia-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

我试图:

  • pod解体并再次安装pod。
  • 删除iOS文件夹并重新创建。 /清理项目,关闭Xcode等。

您知道发生了什么以及如何解决?谢谢!

解决方法

最后在“调试”中克隆项目,更改一些选项以使其发布,然后我就可以工作了。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。