【问题标题】:Could not build the application for the simulator. Error launching application on iPhone 11 Pro?无法为模拟器构建应用程序。在 iPhone 11 Pro 上启动应用程序时出错?
【发布时间】:2020-11-10 01:40:05
【问题描述】:

尝试在 Iphone 上启动我的应用程序时出现此错误。我该如何解决?

Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    duplicate symbol '_pb_field_iter_next' in:
        /Users/johndoe/Library/Developer/Xcode/DerivedData/Runner-awmjwtlfwtwzmhcficfyhoavvpwe/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/nanopb.build/Objects-normal/x86_64/pb_common 2.o
        /Users/johndoe/Library/Developer/Xcode/DerivedData/Runner-awmjwtlfwtwzmhcficfyhoavvpwe/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/nanopb.build/Objects-normal/x86_64/pb_common.o
    duplicate symbol '_pb_field_iter_begin' in:
        /Users/johndoe/Library/Developer/Xcode/DerivedData/Runner-awmjwtlfwtwzmhcficfyhoavvpwe/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/nanopb.build/Objects-normal/x86_64/pb_common 2.o
        /Users/johndoe/Library/Developer/Xcode/DerivedData/Runner-awmjwtlfwtwzmhcficfyhoavvpwe/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/nanopb.build/Objects-normal/x86_64/pb_common.o
    duplicate symbol '_pb_field_iter_find' in:

    ld: 35 duplicate symbols for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator. 
Error launching application on iPhone 11 Pro.

【问题讨论】:

  • 你检查过你的项目目录吗?可能有一些重复的文件,所以你得到了重复符号编译错误?
  • hi zhoujialei 我该如何解决这个问题?
  • 如果是flutter项目,我建议你以某种方式将你的demo上传到github。这样会更容易调试。

标签: java ios android-studio flutter


【解决方案1】:

我遇到了同样的问题,但我发现这行得通。

1 - 更新 Xcode。

2 - 在终端中将 Flutter 升级到最新版本:flutter upgrade

3 - 使用以下命令更新可可豆荚:$ sudo gem install cocoapods

4 - 在 Android studio 终端运行:flutter clean & then flutter run

之后,问题就解决了。

【讨论】:

    【解决方案2】:

    我设法解决了这个问题。我正在关注一个 YT 介绍,以通过模拟器实时调试 flutter/dart/ios

    原来我需要更新颤振及其相关文件。

    我刚刚跑了flutter upgrade --force。我相信这会覆盖任何以前保存的设置,因此可能会在强制升级之前备份您的工作。但是,在运行此程序并更新所有内容后,它再次对我正常工作。

    【讨论】:

      猜你喜欢
      • 2020-05-12
      • 2021-01-21
      • 2021-09-19
      • 2021-06-30
      • 2023-02-12
      • 2011-01-04
      • 2023-03-07
      • 2014-05-03
      • 1970-01-01
      相关资源
      最近更新 更多