FirebaseCoreInternal React Native 的 iOS 构建链接器命令失败

问题描述 投票:0回答:1

我正在尝试在 XCode 15.2 中运行和构建一个旧的但现有的 React Native 应用程序。但我无法修复下面的错误。我在下面列出了我的 package.json 和 podfile。这是 firebase 相关问题还是 Xcode 相关问题?因为我需要为此降级我的 Xcode 版本?

我的设备规格 -> M2 Macbook Pro 8GB

ld: Undefined symbols:
  _swift_stdlib_isStackAllocationSafe, referenced from:
      function signature specialization <Arg[1] = Owned To Guaranteed> of function signature specialization <Arg[0] = [Closure Propagated : reabstraction thunk helper from @callee_guaranteed (@unowned FirebaseCoreInternal.TimePeriod, @in_guaranteed Foundation.Date) -> (@unowned Swift.Bool, @error @owned Swift.Error) to @escaping @callee_guaranteed (@in_guaranteed FirebaseCoreInternal.TimePeriod, @in_guaranteed Foundation.Date) -> (@unowned Swift.Bool, @error @owned Swift.Error), Argument Types : [@callee_guaranteed (@unowned FirebaseCoreInternal.TimePeriod, @in_guaranteed Foundation.Date) -> (@unowned Swift.Bool, @error @owned Swift.Error)]> of generic specialization <FirebaseCoreInternal.TimePeriod, Foundation.Date> of Swift._NativeDictionary.filter(((key: A, value: B)) throws -> Swift.Bool) throws -> Swift._NativeDictionary<A, B> in FirebaseCoreInternal[x86_64][7](HeartbeatController.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

package.json如下:

"@react-native-async-storage/async-storage": "^1.14.1",
        "@react-native-community/cameraroll": "^4.0.4",
        "@react-native-community/masked-view": "0.1.10",
        "@react-native-firebase/app": "^15.4.0",
        "@react-native-firebase/messaging": "^15.1.1",
        "@react-native-picker/picker": "1.9.2",
        "@react-navigation/drawer": "^5.11.4",
        "@react-navigation/native": "^5.8.10",
        "@react-navigation/stack": "^5.12.8",
        "axios": "^0.21.1",
        "dayjs": "^1.11.5",
        "expo": "^40.0.0",
        "expo-location": "~10.0.0",
        "expo-permissions": "~10.0.0",
        "expo-splash-screen": "~0.8.1",
        "expo-status-bar": "~1.0.3",
        "expo-updates": "~0.4.0",
        "geolib": "^3.3.1",
        "jwt-decode": "^3.1.2",
        "patch-package": "^8.0.0",
        "react": "16.13.1",
        "react-dom": "16.13.1",
        "react-native": "~0.63.4",
        "react-native-animated-spinkit": "^1.4.2",
        "react-native-gesture-handler": "~1.8.0",
        "react-native-google-places-autocomplete": "^2.1.2",
        "react-native-image-zoom-viewer": "^3.0.1",
        "react-native-maps": "^1.7.0",
        "react-native-maps-directions": "^1.8.0",
        "react-native-modal": "^11.6.1",
        "react-native-modalize": "^2.0.8",
        "react-native-razorpay": "^2.2.2",
        "react-native-reanimated": "~1.13.0",
        "react-native-safe-area-context": "3.1.9",
        "react-native-screens": "~2.15.2",
        "react-native-simple-toast": "^1.1.3",
        "react-native-snap-carousel": "^3.9.1",
        "react-native-unimodules": "~0.12.0",
        "react-native-web": "~0.13.12",
        "react-query": "^2.26.3",
        "react-redux": "^7.2.2",
        "redux": "^4.0.5",
        "redux-thunk": "^2.3.0",
        "rn-fetch-blob": "^0.12.0"
    },

下面的 Podfile

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '13.4'

target 'userapp' do
  pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/Simon-TechForm/google-maps-ios-utils.git', :branch => 'feat/support-apple-silicon'
  rn_maps_path = '../node_modules/react-native-maps'
  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'react-native-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  use_unimodules!
  use_frameworks! :linkage => :static
  $RNFirebaseAsStaticFramework = true
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  # Uncomment the code below to enable Flipper.
  #
  # You should not install Flipper in CI environments when creating release
  # builds, this will lead to significantly slower build times.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work.
  #
  #  use_flipper!
  #  post_install do |installer|
  #    flipper_post_install(installer)
  #  end
end

尝试了下面的解决方案,但没有成功:

ios swift xcode firebase react-native
1个回答
0
投票

您可以按照以下视频来解决您的问题:

https://youtu.be/eVepCyD3x0I

© www.soinside.com 2019 - 2024. All rights reserved.