首页 > 解决方案 > Flutter:构建 ios 错误:ld:架构 x86_64 的 13 个重复符号

问题描述

在添加 Geolocator 插件遇到一些麻烦后无法正常工作。我从 pubspec.yaml 中删除了 Geolocator,但现在该项目无法为 ios 构建。我已经尝试了 2 天但没有成功,包括:

  1. 更改颤振通道
  2. 颤振升级
  3. Pod 解体
  4. 删除 xcode 项目文件
  5. 添加 'config.build_settings['SWIFT_VERSION'] = '4.1'
  6. 还有更多我现在不记得了。

    重复符号 _OBJC_IVAR_$_MDMPasscodeCache._localAuthenticationInfo 在:/Volumes/flutter/ios/Pods/GoogleMobileVision/Detector/Frameworks/GoogleMobileVision.framework/GoogleMobileVision(MDMPasscodeCache_f189776e75765630b82721fafea64052.o) /Volumes/flutter/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework /GoogleSignIn(MDMPasscodeCache_42de90102bb6814d03833694aafcc99d.o) duplicate symbol _OBJC_IVAR_$_MDMPasscodeCache._keychainInfo in: /Volumes/flutter/ios/Pods/GoogleMobileVision/Detector/Frameworks/GoogleMobileVision.framework/GoogleMobileVision(MDMPasscodeCache_f189776e75765630b82721fafea64052.o) /Volumes/flutter/ios/Pods/ GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(MDMPasscodeCache_42de90102bb6814d03833694aafcc99d.o) 重复符号 _OBJC_IVAR_$_MDMPasscodeCache._hasLocalAuthentication 在:/Volumes/flutter/ios/Pods/GoogleMobileVision/Detector/Frameworks/GoogleMobileVision.framework/GoogleMobileVision(MDMPasscodeCache_f189776e75765630b82721fafea64052.o) /Volumes/flutter/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(MDMPasscodeCache_42de90102bba681cc9080369029029902902990290909000000000000000美元) _OBJC_IVAR_$_MDMPasscodeCache._hasKeychain 在:/Volumes/flutter/ios/Pods/GoogleMobileVision/Detector/Frameworks/GoogleMobileVision.framework/GoogleMobileVision(MDMPasscodeCache_f189776e75765630b82721fafea64052.o) /Volumes/flutter/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/ (MDMPasscodeCache_42de90102bb6814d03833694aafcc99d.o) 重复符号 _OBJC_IVAR_$_MDMPasscodeCache._cachedState 在:/Volumes/flutter/ios/Pods/GoogleMobileVision/Detector/Frameworks/GoogleMobileVision。framework/GoogleMobileVision(MDMPasscodeCache_f189776e75765630b82721fafea64052.o) /Volumes/flutter/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(MDMPasscodeCache_42de90102bb6814d03833694aafcc99d.o) duplicate symbol _OBJC_IVAR_$_MDMPasscodeCache._keychainExpireTime in: /Volumes/flutter/ios/Pods/GoogleMobileVision /Detector/Frameworks/GoogleMobileVision.framework/GoogleMobileVision(MDMPasscodeCache_f189776e75765630b82721fafea64052.o) /Volumes/flutter/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(MDMPasscodeCache_42de90102bb6814d03833694aafcc99d.o) duplicate symbol _OBJC_CLASS_$_MDMPasscodeCache in: /Volumes/flutter/ ios/Pods/GoogleMobileVision/Detector/Frameworks/GoogleMobileVision.framework/GoogleMobileVision(MDMPasscodeCache_f189776e75765630b82721fafea64052.o) /Volumes/flutter/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(MDMPasscodeCache_42de90102bb6814d03833694aafcc99d.o) 重复符号 _OBJC_METACLASS_$_MDMPasscodeCache 在:/Volumes/flutter/ios/Pods/GoogleMobileVision/Detector/Frameworks/GoogleMobileVision.framework /GoogleMobileVision(MDMPasscodeCache_f189776e75765630b82721fafea64052.o) /Volumes/flutter/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(MDMPasscodeCache_42de90102bb6814d03833694aafcc99d.o) duplicate symbol _OBJC_IVAR_$_MDMPasscodeCache._hasEnteredBackground in: /Volumes/flutter/ios/Pods/GoogleMobileVision/检测器/框架/GoogleMobileVision.framework/GoogleMobileVision(MDMPasscodeCache_f189776e75765630b82721fafea64052.o)/Volumes/flutter/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn。framework/GoogleSignIn(MDMPasscodeCache_42de90102bb6814d03833694aafcc99d.o) duplicate symbol _OBJC_IVAR_$_MDMPasscodeState._status in: /Volumes/flutter/ios/Pods/GoogleMobileVision/Detector/Frameworks/GoogleMobileVision.framework/GoogleMobileVision(MDMPasscodeState_d2697588db599ad1e82d46f342216cee.o) /Volumes/flutter/ios/Pods /GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(MDMPasscodeState_adbe96d99863168799049cc0f0164c6d.o) duplicate symbol _OBJC_IVAR_$_MDMPasscodeState._info in: /Volumes/flutter/ios/Pods/GoogleMobileVision/Detector/Frameworks/GoogleMobileVision.framework/GoogleMobileVision(MDMPasscodeState_d2697588db599ad1e82d46f342216cee.o) / Volumes/flutter/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(MDMPasscodeState_adbe96d99863168799049cc0f0164c6d.o) 重复符号 _OBJC_CLASS_$_MDMPasscodeState 在:/Volumes/flutter/ios/Pods/GoogleMobileVision/Detector/Frameworks/GoogleMobileVision.framework/GoogleMobileVision(MDMPasscodeState_d2697588db599ad1e82d46f342216cee.o) /Volumes/flutter/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(MDMPasscodeState_adbe96d998603164c69d998603168769) _OBJC_METACLASS_$_MDMPasscodeState in: /Volumes/flutter/ios/Pods/GoogleMobileVision/Detector/Frameworks/GoogleMobileVision.framework/GoogleMobileVision(MDMPasscodeState_d2697588db599ad1e82d46f342216cee.o) /Volumes/flutter/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(MDMPasscodeState_adbe96d99863168799049cc0f0164c6d .o) ld:架构 x86_64 clang 的 13 个重复符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)链接器命令失败,退出代码为 1(使用 -v 查看调用)链接器命令失败,退出代码为 1(使用 -v 查看调用)链接器命令失败,退出代码为 1(使用 -v 查看调用)链接器命令失败,退出代码为 1(使用 -v 查看调用)framework/GoogleMobileVision(MDMPasscodeState_d2697588db599ad1e82d46f342216cee.o) /Volumes/flutter/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(MDMPasscodeState_adbe96d99863168799049cc0f0164c6d.o) duplicate symbol _OBJC_METACLASS_$_MDMPasscodeState in: /Volumes/flutter/ios/Pods/GoogleMobileVision/Detector /Frameworks/GoogleMobileVision.framework/GoogleMobileVision(MDMPasscodeState_d2697588db599ad1e82d46f342216cee.o) /Volumes/flutter/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(MDMPasscodeState_adbe96d99863168799049cc0f0164c6d.o) 复制代码:x command_64 错误链接架构退出代码 1 失败(使用 -v 查看调用)framework/GoogleMobileVision(MDMPasscodeState_d2697588db599ad1e82d46f342216cee.o) /Volumes/flutter/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(MDMPasscodeState_adbe96d99863168799049cc0f0164c6d.o) duplicate symbol _OBJC_METACLASS_$_MDMPasscodeState in: /Volumes/flutter/ios/Pods/GoogleMobileVision/Detector /Frameworks/GoogleMobileVision.framework/GoogleMobileVision(MDMPasscodeState_d2697588db599ad1e82d46f342216cee.o) /Volumes/flutter/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn(MDMPasscodeState_adbe96d99863168799049cc0f0164c6d.o) 重复符号:x command_64 错误链接架构退出代码 1 失败(使用 -v 查看调用)framework/GoogleSignIn(MDMPasscodeState_adbe96d99863168799049cc0f0164c6d.o) duplicate symbol _OBJC_METACLASS_$_MDMPasscodeState in: /Volumes/flutter/ios/Pods/GoogleMobileVision/Detector/Frameworks/GoogleMobileVision.framework/GoogleMobileVision(MDMPasscodeState_d2697588db599ad1e82d46f342216cee.o) /Volumes/flutter/ios/Pods/GoogleSignIn /Frameworks/GoogleSignIn.framework/GoogleSignIn(MDMPasscodeState_adbe96d99863168799049cc0f0164c6d.o) ld:架构 x86_64 clang 的 13 个重复符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)framework/GoogleSignIn(MDMPasscodeState_adbe96d99863168799049cc0f0164c6d.o) duplicate symbol _OBJC_METACLASS_$_MDMPasscodeState in: /Volumes/flutter/ios/Pods/GoogleMobileVision/Detector/Frameworks/GoogleMobileVision.framework/GoogleMobileVision(MDMPasscodeState_d2697588db599ad1e82d46f342216cee.o) /Volumes/flutter/ios/Pods/GoogleSignIn /Frameworks/GoogleSignIn.framework/GoogleSignIn(MDMPasscodeState_adbe96d99863168799049cc0f0164c6d.o) ld:架构 x86_64 clang 的 13 个重复符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)framework/GoogleSignIn(MDMPasscodeState_adbe96d99863168799049cc0f0164c6d.o) ld:架构 x86_64 clang 的 13 个重复符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)framework/GoogleSignIn(MDMPasscodeState_adbe96d99863168799049cc0f0164c6d.o) ld:架构 x86_64 clang 的 13 个重复符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

现在,我不知道如何解决这个问题。

更新:现在删除并重新安装 CocoaPods 后出现新错误:

分析依赖 关系获取 podspec 为Flutterfrom.symlinks/flutter/ios 获取 podspec 为cloud_firestorefrom.symlinks/plugins/cloud_firestore/ios 获取 podspec 为connectivityfrom _ _ _ _ _ _ _ _ _ 获取 podspec for from 获取 podspec for from 获取 podspec for from.symlinks/plugins/connectivity/iosfirebase_admob.symlinks/plugins/firebase_admob/iosfirebase_analytics.symlinks/plugins/firebase_analytics/iosfirebase_auth.symlinks/plugins/firebase_auth/iosfirebase_core.symlinks/plugins/firebase_core/iosfirebase_messaging.symlinks/plugins/firebase_messaging/iosfirebase_storage.symlinks/plugins/firebase_storage/iosflutter_native_image.symlinks/plugins/flutter_native_image/iosgoogle_sign_in.symlinks/plugins/google_sign_in/iosimage_picker.symlinks/plugins/image_picker/iosnative_device_orientation.symlinks/plugins/native_device_orientation/iospackage_info.symlinks/plugins/package_info/iospath_provider.symlinks/plugins/path_provider/iosqr_mobile_vision从[ ! ]获取 podspec.symlinks/plugins/qr_mobile_vision/ios 获取 podspecshare.symlinks/plugins/share/iosurl_launcher.symlinks/plugins/url_launcher/ios.symlinks/plugins/firebase_admob/ios

找到了满足Firebase/AdMob依赖关系的规范,但它们需要更高的最小部署目标。CocoaPods 找不到 pod "GoogleUtilities/AppDelegateSwizzler" 的兼容版本:在 Podfile 中:firebase_admob(来自.symlinks/plugins/firebase_admob/ios)被解析为 0.0.1,这取决于 Firebase/AdMob 被解析为 5.8.0,这取决于 Firebase/Core(= 5.8 .0) 被解析为 5.8.0,这取决于 FirebaseAnalytics (= 5.1.2) 被解析为 5.1.2,这取决于 GoogleUtilities/AppDelegateSwizzler (~> 5.2.0)

找到了满足GoogleUtilities/AppDelegateSwizzler (~> 5.2.0)依赖关系的规范,但它们需要更高的最小部署目标。CocoaPods 找不到 pod "gRPC-Core" 的兼容版本:在 Podfile 中:cloud_firestore (from .symlinks/plugins/cloud_firestore/ios) 被解析为 0.0.1,它依赖于 Firebase/Firestore 被解析为 5.8.0,它依赖于 FirebaseFirestore (= 0.13.3 ) 被解析为 0.13.3,这取决于 gRPC-C++ (~> 0.0.3) 被解析为 0.0.3,这取决于 gRPC-C++/Implementation (= 0.0.3) 被解析为 0.0.3,这取决于 gRPC-Core (= 1.14.0)

cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
  Firebase/Firestore was resolved to 5.8.0, which depends on
    FirebaseFirestore (= 0.13.3) was resolved to 0.13.3, which depends on
      gRPC-ProtoRPC (~> 1.0) was resolved to 1.14.1, which depends on
        gRPC-ProtoRPC/Main (= 1.14.1) was resolved to 1.14.1, which depends on
          gRPC (= 1.14.1) was resolved to 1.14.1, which depends on
            gRPC/Main (= 1.14.1) was resolved to 1.14.1, which depends on
              gRPC-Core (= 1.14.1)

标签: iosflutter

解决方案


推荐阅读