ld:迁移项目后找不到框架Flutter

时间:2020-07-10 20:41:37

标签: xcode flutter ios-simulator

尝试在Xcode中构建Flutter应用程序时收到以下错误消息:

ld: framework not found Flutter
clang: error: linker command failed with exit code 1 (use -v to see invocation)

当阅读发生类似错误的帖子时,建议的修复方法是将Flutter.framework文件添加到项目中,但是本指南中概述的步骤涉及删除此文件:

https://flutter.dev/docs/development/ios-project-migration

当我将App.frameworkFlutter.framework文件重新添加到我的应用程序中并尝试在VS Code中使用flutter build ios时,我收到一条错误消息,告诉我要迁移项目并提供指向指南的链接以上。因此,似乎这两种解决方案都不起作用。

这是flutter doctor --v的输出:

[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.5 19F101, locale en-GB)
    • Flutter version 1.17.5 at /Users/gregorysheen/Dev/flutter
    • Framework revision 8af6b2f038 (10 days ago), 2020-06-30 12:53:55 -0700
    • Engine revision ee76268252
    • Dart version 2.8.4

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/gregorysheen/Library/Android/sdk
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.5, Build version 11E608c
    • CocoaPods version 1.9.3

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build
      1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.46.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.12.1

[!] Connected device
    ! No devices available

1 个答案:

答案 0 :(得分:0)

将插件(flutter和dart)添加到android studio。 如果您已添加,则请卸载并重新安装

enter image description here

点击配置并选择插件,然后执行上述步骤。