Xcode 15.4 错误:仅显示最近的错误链接器命令失败,退出代码为 1(使用 -v 查看调用)

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

在 React Native 应用程序中,当我尝试在 Xcode 中构建应用程序时,出现以下错误:

仅显示最近的错误

Linker command failed with exit code 1 (use    -v to see invocation)

更详细的日志:

Undefined symbols for architecture x86_64:
"\_FIRFirebaseVersion", referenced from:
+\[FIRAnalytics topLevelVersion\] in FirebaseAnalytics\[x86_64\]\[10\](FIRAnalytics.o)
"\_FIRInstallationIDDidChangeNotification", referenced from:
+\[FIRAnalytics observeFirebaseInstallationIDChanges\] in FirebaseAnalytics\[x86_64\]\[10\](FIRAnalytics.o)
"\_GULIsLoggableLevel", referenced from:
\-\[APMMonitor isLoggableLevel:\] in GoogleAppMeasurement\[x86_64\]\[68\](APMMonitor.o)
"\_GULLogBasic", referenced from:
\-\[APMASLLogger logMessage:logTag:messageCode:withLogLevel:\] in GoogleAppMeasurement\[x86_64\]\[12\](APMASLLogger.o)
"\_GULLogError", referenced from:
\-\[APMPersistentDictionary initWithFileName:\] in GoogleAppMeasurement\[x86_64\]\[257\](APMPersistentDictionary.o)
\_APMWriteDictionaryToURL in GoogleAppMeasurement\[x86_64\]\[257\](APMPersistentDictionary.o)
\-\[APMUserDefaults synchronize\] in GoogleAppMeasurement\[x86_64\]\[311\](APMUserDefaults.o)
"\_GULLogInfo", referenced from:
\___44+\[UIViewController(APMScreenClassName) load\]\_block_invoke in GoogleAppMeasurement\[x86_64\]\[330\](UIViewController+APMScreenClassName.o)
"\_GULLogWarning", referenced from:
+\[APMMeasurement sharedInstance\] in GoogleAppMeasurement\[x86_64\]\[62\](APMMeasurement.o)
\-\[APMPersistentDictionary objectForKey:\] in GoogleAppMeasurement\[x86_64\]\[257\](APMPersistentDictionary.o)
\-\[APMPersistentDictionary setObject:forKey:\] in GoogleAppMeasurement\[x86_64\]\[257\](APMPersistentDictionary.o)
\-\[APMPersistentDictionary setObject:forKey:\] in GoogleAppMeasurement\[x86_64\]\[257\](APMPersistentDictionary.o)
\-\[APMUserDefaults objectForKey:\] in GoogleAppMeasurement\[x86_64\]\[311\](APMUserDefaults.o)
\-\[APMUserDefaults setObject:forKey:\] in GoogleAppMeasurement\[x86_64\]\[311\](APMUserDefaults.o)
\-\[APMUserDefaults setObject:forKey:\] in GoogleAppMeasurement\[x86_64\]\[311\](APMUserDefaults.o)
...
"\_GULSetLoggerLevel", referenced from:
\-\[APMMonitor setDebugModeEnabled:\] in GoogleAppMeasurement\[x86_64\]\[68\](APMMonitor.o)
\-\[APMMonitor setDebugModeEnabled:\] in GoogleAppMeasurement\[x86_64\]\[68\](APMMonitor.o)
\-\[APMMonitor setVerboseLoggingEnabled:\] in GoogleAppMeasurement\[x86_64\]\[68\](APMMonitor.o)
"_OBJC_CLASS_$\_FIRApp", referenced from:
in AppDelegate.o
"_OBJC_CLASS_$\_FIRComponent", referenced from:
in FirebaseAnalytics\[x86_64\]\[11\](FIRAnalyticsConnector.o)
"_OBJC_CLASS_$\_FIRInstallations", referenced from:
in FirebaseAnalytics\[x86_64\]\[10\](FIRAnalytics.o)
"_OBJC_CLASS_$\_GULAppDelegateSwizzler", referenced from:
in GoogleAppMeasurement\[x86_64\]\[7\](APMAnalytics.o)
"_OBJC_CLASS_$\_GULAppEnvironmentUtil", referenced from:
in GoogleAppMeasurement\[x86_64\]\[5\](APMAEU.o)
"_OBJC_CLASS_$\_GULMutableDictionary", referenced from:
in GoogleAppMeasurement\[x86_64\]\[35\](APMEExperiment.o)
"_OBJC_CLASS_$\_GULNetwork", referenced from:
in GoogleAppMeasurement\[x86_64\]\[7\](APMAnalytics.o)
"_OBJC_CLASS_$\_GULSwizzler", referenced from:
in GoogleAppMeasurement\[x86_64\]\[330\](UIViewController+APMScreenClassName.o)
"_OBJC_CLASS_$\_RCTAppDelegate", referenced from:
_OBJC_CLASS_$\_AppDelegate in AppDelegate.o
"_OBJC_CLASS_$\_RCTBundleURLProvider", referenced from:
in AppDelegate.o
"_OBJC_CLASS_$\_RCTConvert", referenced from:
\__OBJC_$_CATEGORY_RCTConvert_$\_RNZoomVideoSdk in react_native_zoom_video_sdk\[3\](RCTConvert+RNZoomVideoSdk.o)
in react_native_zoom_video_sdk\[5\](RNZoomVideoSdk.o)
"_OBJC_CLASS_$\_RCTEventEmitter", referenced from:
_OBJC_CLASS_$\_RNZoomVideoSdk in react_native_zoom_video_sdk\[5\](RNZoomVideoSdk.o)
"_OBJC_CLASS_$\_RCTView", referenced from:
_OBJC_CLASS_$\_RNZoomView in react_native_zoom_video_sdk\[35\](RNZoomView.o)
"_OBJC_CLASS_$\_RCTViewManager", referenced from:
_OBJC_CLASS_$\_RNZoomViewViewManager in react_native_zoom_video_sdk\[36\](RNZoomViewViewManager.o)
"_OBJC_METACLASS_$\_RCTAppDelegate", referenced from:
_OBJC_METACLASS_$\_AppDelegate in AppDelegate.o
"_OBJC_METACLASS_$\_RCTEventEmitter", referenced from:
_OBJC_METACLASS_$\_RNZoomVideoSdk in react_native_zoom_video_sdk\[5\](RNZoomVideoSdk.o)
"_OBJC_METACLASS_$\_RCTView", referenced from:
_OBJC_METACLASS_$\_RNZoomView in react_native_zoom_video_sdk\[35\](RNZoomView.o)
"_OBJC_METACLASS_$\_RCTViewManager", referenced from:
_OBJC_METACLASS_$\_RNZoomViewViewManager in react_native_zoom_video_sdk\[36\](RNZoomViewViewManager.o)
"\_RCTConvertEnumValue", referenced from:
+\[RCTConvert(RNZoomVideoSdk) ZoomVideoSDKRawDataMemoryMode:\] in react_native_zoom_video_sdk\[3\](RCTConvert+RNZoomVideoSdk.o)
+\[RCTConvert(RNZoomVideoSdk) ZoomVideoSDKVideoPreferenceMode:\] in react_native_zoom_video_sdk\[3\](RCTConvert+RNZoomVideoSdk.o)
+\[RCTConvert(RNZoomVideoSdk) ZoomVideoSDKReceiveSharingStatus:\] in react_native_zoom_video_sdk\[3\](RCTConvert+RNZoomVideoSdk.o)
+\[RCTConvert(RNZoomVideoSdk) ZoomVideoSDKRecordingStatus:\] in react_native_zoom_video_sdk\[3\](RCTConvert+RNZoomVideoSdk.o)
+\[RCTConvert(RNZoomVideoSdk) ZoomVideoSDKError:\] in react_native_zoom_video_sdk\[3\](RCTConvert+RNZoomVideoSdk.o)
+\[RCTConvert(RNZoomVideoSdk) ZoomVideoSDKAudioType:\] in react_native_zoom_video_sdk\[3\](RCTConvert+RNZoomVideoSdk.o)
+\[RCTConvert(RNZoomVideoSdk) ZoomVideoSDKVideoAspect:\] in react_native_zoom_video_sdk\[3\](RCTConvert+RNZoomVideoSdk.o)
...
"\_RCTPresentedViewController", referenced from:
\___54-\[RNZoomVideoSdkShareHelper shareScreen:withRejecter:\]\_block_invoke in react_native_zoom_video_sdk\[25\](RNZoomVideoSdkShareHelper.o)
"\_RCTRegisterModule", referenced from:
+\[RNZoomVideoSdk load\] in react_native_zoom_video_sdk\[5\](RNZoomVideoSdk.o)
+\[RNZoomVideoSdkAnnotationHelper load\] in react_native_zoom_video_sdk\[6\](RNZoomVideoSdkAnnotationHelper.o)
+\[RNZoomVideoSdkAudioHelper load\] in react_native_zoom_video_sdk\[7\](RNZoomVideoSdkAudioHelper.o)
+\[RNZoomVideoSdkAudioSettingHelper load\] in react_native_zoom_video_sdk\[8\](RNZoomVideoSdkAudioSettingHelper.o)
+\[RNZoomVideoSdkAudioStatus load\] in react_native_zoom_video_sdk\[9\](RNZoomVideoSdkAudioStatus.o)
+\[RNZoomVideoSdkChatHelper load\] in react_native_zoom_video_sdk\[10\](RNZoomVideoSdkChatHelper.o)
+\[RNZoomVideoSdkChatMessage load\] in react_native_zoom_video_sdk\[11\](RNZoomVideoSdkChatMessage.o)
...
"\_kFIRLoggerAnalytics", referenced from:
+\[FIRAnalytics startWithConfiguration:options:\] in FirebaseAnalytics\[x86_64\]\[10\](FIRAnalytics.o)
"\_kGULNetworkHTTPStatusCodeCannotAcceptTraffic", referenced from:
\-\[APMETaskManager handleFetchingExperimentsResponse:data:error:\] in GoogleAppMeasurement\[x86_64\]\[42\](APMETaskManager.o)
\-\[APMMeasurement networkUploadCompletionHandlerWithResponse:error:\] in GoogleAppMeasurement\[x86_64\]\[62\](APMMeasurement.o)
\-\[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:\] in GoogleAppMeasurement\[x86_64\]\[62\](APMMeasurement.o)
"\_kGULNetworkHTTPStatusCodeNotFound", referenced from:
\-\[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:\] in GoogleAppMeasurement\[x86_64\]\[62\](APMMeasurement.o)
\-\[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:\] in GoogleAppMeasurement\[x86_64\]\[62\](APMMeasurement.o)
"\_kGULNetworkHTTPStatusCodeNotModified", referenced from:
\___37-\[APMMeasurement retrievePSMResponse\]\_block_invoke in GoogleAppMeasurement\[x86_64\]\[62\](APMMeasurement.o)
\-\[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:\] in GoogleAppMeasurement\[x86_64\]\[62\](APMMeasurement.o)
\-\[APMMeasurement(SKAN) handleSKANFetchResponse:data:error:\] in GoogleAppMeasurement\[x86_64\]\[66\](APMMeasurement+SKAN.o)
\___46-\[APMMeasurement(URL) requestDeferredDeepLink\]\_block_invoke in GoogleAppMeasurement\[x86_64\]\[67\](APMMeasurement+URL.o)
"\_kGULNetworkHTTPStatusCodeUnavailable", referenced from:
\-\[APMETaskManager handleFetchingExperimentsResponse:data:error:\] in GoogleAppMeasurement\[x86_64\]\[42\](APMETaskManager.o)
\-\[APMMeasurement networkUploadCompletionHandlerWithResponse:error:\] in GoogleAppMeasurement\[x86_64\]\[62\](APMMeasurement.o)
\-\[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:\] in GoogleAppMeasurement\[x86_64\]\[62\](APMMeasurement.o)
"\_kGULNetworkHTTPStatusNoContent", referenced from:
\-\[APMETaskManager handleFetchingExperimentsResponse:data:error:\] in GoogleAppMeasurement\[x86_64\]\[42\](APMETaskManager.o)
\-\[APMMeasurement networkUploadCompletionHandlerWithResponse:error:\] in GoogleAppMeasurement\[x86_64\]\[62\](APMMeasurement.o)
\___37-\[APMMeasurement retrievePSMResponse\]\_block_invoke in GoogleAppMeasurement\[x86_64\]\[62\](APMMeasurement.o)
\-\[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:\] in GoogleAppMeasurement\[x86_64\]\[62\](APMMeasurement.o)
\___46-\[APMMeasurement(URL) requestDeferredDeepLink\]\_block_invoke in GoogleAppMeasurement\[x86_64\]\[67\](APMMeasurement+URL.o)
"\_kGULNetworkHTTPStatusOK", referenced from:
\-\[APMETaskManager handleFetchingExperimentsResponse:data:error:\] in GoogleAppMeasurement\[x86_64\]\[42\](APMETaskManager.o)
\-\[APMMeasurement networkUploadCompletionHandlerWithResponse:error:\] in GoogleAppMeasurement\[x86_64\]\[62\](APMMeasurement.o)
\___37-\[APMMeasurement retrievePSMResponse\]\_block_invoke in GoogleAppMeasurement\[x86_64\]\[62\](APMMeasurement.o)
\-\[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:\] in GoogleAppMeasurement\[x86_64\]\[62\](APMMeasurement.o)
\-\[APMMeasurement(SKAN) handleSKANFetchResponse:data:error:\] in GoogleAppMeasurement\[x86_64\]\[66\](APMMeasurement+SKAN.o)
\___46-\[APMMeasurement(URL) requestDeferredDeepLink\]\_block_invoke in GoogleAppMeasurement\[x86_64\]\[67\](APMMeasurement+URL.o)
"\_pb_decode", referenced from:
\_apmpb_decode_app_property in GoogleAppMeasurement\[x86_64\]\[78\](apmpb_app_property_decoder.o)
\_apmpb_decode_audience in GoogleAppMeasurement\[x86_64\]\[81\](apmpb_audience_decoder.o)
\_apmpb_decode_audience in GoogleAppMeasurement\[x86_64\]\[81\](apmpb_audience_decoder.o)
\_apmpb_decode_audience_leaf_filter_result in GoogleAppMeasurement\[x86_64\]\[84\](apmpb_audience_leaf_filter_result_decoder.o)
\_apmpb_decode_audience_leaf_filter_result in GoogleAppMeasurement\[x86_64\]\[84\](apmpb_audience_leaf_filter_result_decoder.o)
\_apmpb_decode_client_property in GoogleAppMeasurement\[x86_64\]\[87\](apmpb_client_property_decoder.o)
\_apmpb_decode_client_property in GoogleAppMeasurement\[x86_64\]\[87\](apmpb_client_property_decoder.o)
...
"\_pb_decode_varint", referenced from:
\_nano_decode_repeated_uint64 in GoogleAppMeasurement\[x86_64\]\[315\](decoder_common.o)
"\_pb_encode", referenced from:
\_nano_two_pass_encoding in GoogleAppMeasurement\[x86_64\]\[316\](encoder_common.o)
\_nano_two_pass_encoding in GoogleAppMeasurement\[x86_64\]\[316\](encoder_common.o)
"\_pb_encode_string", referenced from:
\_nano_encode_string in GoogleAppMeasurement\[x86_64\]\[316\](encoder_common.o)
"\_pb_encode_submessage", referenced from:
\_apmpb_encode_repeated_app_property in GoogleAppMeasurement\[x86_64\]\[79\](apmpb_app_property_encoder.o)
\_apmpb_encode_repeated_audience in GoogleAppMeasurement\[x86_64\]\[82\](apmpb_audience_encoder.o)
\_apmpb_encode_repeated_audience_leaf_filter_result in GoogleAppMeasurement\[x86_64\]\[85\](apmpb_audience_leaf_filter_result_encoder.o)
\_apmpb_encode_repeated_client_property in GoogleAppMeasurement\[x86_64\]\[88\](apmpb_client_property_encoder.o)
\_apmpb_encode_repeated_consent_config in GoogleAppMeasurement\[x86_64\]\[91\](apmpb_consent_config_encoder.o)
\_apmpb_encode_repeated_consent_default_entry in GoogleAppMeasurement\[x86_64\]\[94\](apmpb_consent_default_entry_encoder.o)
\_apmpb_encode_repeated_consent_delegation_entry in GoogleAppMeasurement\[x86_64\]\[97\](apmpb_consent_delegation_entry_encoder.o)
...
"\_pb_encode_tag_for_field", referenced from:
\_apmpb_encode_repeated_app_property in GoogleAppMeasurement\[x86_64\]\[79\](apmpb_app_property_encoder.o)
\_apmpb_encode_repeated_audience in GoogleAppMeasurement\[x86_64\]\[82\](apmpb_audience_encoder.o)
\_apmpb_encode_repeated_audience_leaf_filter_result in GoogleAppMeasurement\[x86_64\]\[85\](apmpb_audience_leaf_filter_result_encoder.o)
\_apmpb_encode_repeated_client_property in GoogleAppMeasurement\[x86_64\]\[88\](apmpb_client_property_encoder.o)
\_apmpb_encode_repeated_consent_config in GoogleAppMeasurement\[x86_64\]\[91\](apmpb_consent_config_encoder.o)
\_apmpb_encode_repeated_consent_default_entry in GoogleAppMeasurement\[x86_64\]\[94\](apmpb_consent_default_entry_encoder.o)
\_apmpb_encode_repeated_consent_delegation_entry in GoogleAppMeasurement\[x86_64\]\[97\](apmpb_consent_delegation_entry_encoder.o)
...
"\_pb_encode_varint", referenced from:
\_nano_encode_repeated_uint64 in GoogleAppMeasurement\[x86_64\]\[316\](encoder_common.o)
"\_pb_istream_from_buffer", referenced from:
\_apmpb_decode_app_property in GoogleAppMeasurement\[x86_64\]\[78\](apmpb_app_property_decoder.o)
\_apmpb_decode_audience in GoogleAppMeasurement\[x86_64\]\[81\](apmpb_audience_decoder.o)
\_apmpb_decode_audience in GoogleAppMeasurement\[x86_64\]\[81\](apmpb_audience_decoder.o)
\_apmpb_decode_audience_leaf_filter_result in GoogleAppMeasurement\[x86_64\]\[84\](apmpb_audience_leaf_filter_result_decoder.o)
\_apmpb_decode_audience_leaf_filter_result in GoogleAppMeasurement\[x86_64\]\[84\](apmpb_audience_leaf_filter_result_decoder.o)
\_apmpb_decode_client_property in GoogleAppMeasurement\[x86_64\]\[87\](apmpb_client_property_decoder.o)
\_apmpb_decode_client_property in GoogleAppMeasurement\[x86_64\]\[87\](apmpb_client_property_decoder.o)
...
"\_pb_ostream_from_buffer", referenced from:
\_nano_two_pass_encoding in GoogleAppMeasurement\[x86_64\]\[316\](encoder_common.o)
"\_pb_read", referenced from:
\_apmpb_decode_repeated_app_property in GoogleAppMeasurement\[x86_64\]\[78\](apmpb_app_property_decoder.o)
\_apmpb_decode_repeated_app_property in GoogleAppMeasurement\[x86_64\]\[78\](apmpb_app_property_decoder.o)
\_apmpb_decode_repeated_audience in GoogleAppMeasurement\[x86_64\]\[81\](apmpb_audience_decoder.o)
\_apmpb_decode_repeated_audience in GoogleAppMeasurement\[x86_64\]\[81\](apmpb_audience_decoder.o)
\_apmpb_decode_repeated_audience_leaf_filter_result in GoogleAppMeasurement\[x86_64\]\[84\](apmpb_audience_leaf_filter_result_decoder.o)
\_apmpb_decode_repeated_audience_leaf_filter_result in GoogleAppMeasurement\[x86_64\]\[84\](apmpb_audience_leaf_filter_result_decoder.o)
\_apmpb_decode_repeated_client_property in GoogleAppMeasurement\[x86_64\]\[87\](apmpb_client_property_decoder.o)
\_apmpb_decode_repeated_client_property in GoogleAppMeasurement\[x86_64\]\[87\](apmpb_client_property_decoder.o)
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

配置:

  • Mackbook Pro [Apple M1 Pro] [索诺玛 14.2]

  • Xcode 15.4

  • 模拟器iPhone 15 [17.2]

  • 反应[18.2.0]

  • 反应原生[0.73.4]

  • aws 放大 [6.0.17]

我尝试过以下方法:

  • 删除node_modules并重新运行pod install

  • 尝试删除〜/ Library / Developer / Xcode / DerivedData以及在线提供的各种其他解决方案

ios react-native apple-m1 xcode15
1个回答
0
投票

您遇到的错误与链接器无法找到 x86_64 架构所需的符号有关,这可能是由于您的依赖项与目标架构之间的兼容性问题所致。

您可以采取以下几个步骤来尝试解决此问题:

  1. 更新依赖项: 确保所有依赖项都是最新的。您可以通过运行以下命令来执行此操作: 重击

npm 安装

cd ios

pod install --repo-update

  1. 检查 Podfile 是否存在架构问题: 由于您使用的是配备 M1 Pro 芯片的 Mac,因此 arm64 架构可能存在问题。您可以尝试通过将以下内容添加到 Podfile 来排除模拟器的 arm64 架构: 红宝石

    post_install |安装程序| installer.pods_project.build_configurations.each 执行 |config| config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64' 结尾 结束

  2. 清理 Xcode 构建文件夹: 在 Xcode 中,转到“产品”>“清理构建文件夹”或使用快捷键 Shift + Command + K。然后再次尝试构建项目。

  3. 检查 Firebase 和其他库的兼容性: 确保 Firebase 和其他相关库的版本与 React Native 0.73.4 兼容。您可能需要参阅 Firebase 文档或检查相应 GitHub 存储库中的任何问题。

  4. 确保 Xcode 中的构建设置正确: 检查您的 Xcode 项目设置以确保目标架构正确。导航到 Build Settings 并确保 Architectures 字段同时包含 arm64 和 x86_64。

  5. 切换到罗塞塔: 尝试在 Rosetta 下运行 Xcode。右键单击“应用程序”文件夹中的 Xcode,单击“获取信息”,然后选中“使用 Rosetta 打开”。如果与本机 M1 架构不兼容,这可能会有所帮助。

  6. 重新运行项目: 进行这些更改后,尝试再次运行该项目: 重击

    npx 反应本机运行 ios

  7. 检查 Firebase 集成: 如果问题仍然存在,可能与 Firebase 集成到您的项目的方式有关。确保正确添加和初始化 Firebase 依赖项。您可能还想尝试删除 Firebase 并按照最新的集成指南将其添加回来。 如果这些解决方案都不起作用,您可能需要深入研究错误日志中提到的特定库,并确保它们正确链接并与您的项目设置兼容。

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