【问题标题】:Undefined symbols for architecture x86_64 , flutter ios架构 x86_64 的未定义符号,颤振 ios
【发布时间】:2021-12-24 10:13:43
【问题描述】:

我正在使用带有 m1 芯片的 mac。

我的项目在模拟器上完美运行,同时使用 Runner.xcodeproj 运行, 但是在使用 Runner.xcworkspace 运行时,它会抛出以下错误。

Undefined symbols for architecture x86_64:
  "OBJC_CLASS$_CSToastStyle", referenced from:
      objc-class-ref in FluttertoastPlugin.o
  "_CSToastPositionTop", referenced from:
      -[FluttertoastPlugin handleMethodCall:result:] in FluttertoastPlugin.o
  "_CSToastPositionCenter", referenced from:
      -[FluttertoastPlugin handleMethodCall:result:] in FluttertoastPlugin.o
  "_CSToastPositionBottom", referenced from:
      -[FluttertoastPlugin handleMethodCall:result:] in FluttertoastPlugin.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

试过了: 删除 pod 文件、pod.lock、pod 并重新安装。

flutter clean; rm ios/Podfile ios/Podfile.lock pubspec.lock; rm -rf ios/Pods ios/Runner.xcworkspace; flutter run

从新项目导入的 ios 文件也不起作用。

提前致谢。

【问题讨论】:

    标签: ios xcode flutter flutter-dependencies


    【解决方案1】:

    我也遇到了同样的错误, 这是解决此错误的步骤

    1. 在 xcode 中打开 Runner.xcworkspace,

    2. 转到 Pod 项目

    3. 转到构建设置 -> 构建架构

      并将调试方案的每个构建架构更改为“是”

    【讨论】:

    • 仅构建活动架构已设置为 NO 除了调试,我仍然收到此错误。
    猜你喜欢
    • 2020-08-31
    • 2015-12-04
    • 1970-01-01
    • 2014-11-07
    • 2016-11-07
    • 1970-01-01
    • 1970-01-01
    • 2014-08-07
    • 2012-07-20
    相关资源
    最近更新 更多