ios - 将今天的扩展添加到 flutter 应用程序的问题

我在 Flutter 中编写了一个应用程序,我希望为其添加一个原生 iOS Today 扩展。我添加了小部件目标,但是当我尝试构建构建失败时,因为应用扩展目标找不到特定的 flutter 库(这没有意义,因为它无论如何都不会使用它们)。

据我所知,xCode 项目正在尝试将 Flutter 库包含在所有目标中?

这是错误:

ld: warning: directory not found for option '-F/Users/nickmowen/Library/Developer/Xcode/DerivedData/Runner-egikkgpuyfdkbcconodjborapzme/Build/Products/Debug-iphoneos/share'
ld: warning: directory not found for option '-F/Users/nickmowen/Library/Developer/Xcode/DerivedData/Runner-egikkgpuyfdkbcconodjborapzme/Build/Products/Debug-iphoneos/shared_preferences'
ld: warning: directory not found for option '-F/Users/nickmowen/Library/Developer/Xcode/DerivedData/Runner-egikkgpuyfdkbcconodjborapzme/Build/Products/Debug-iphoneos/sqflite'
ld: warning: directory not found for option '-F/Users/nickmowen/Library/Developer/Xcode/DerivedData/Runner-egikkgpuyfdkbcconodjborapzme/Build/Products/Debug-iphoneos/url_launcher'
ld: framework not found FMDB
clang: error: linker command failed with exit code 1 (use -v to see invocation)

有解决这个问题的想法吗?谢谢!

编辑:

进入 Pods 并为其中的每个 flutter 库启用位码消除了一堆错误,但后来我收到了这个错误:

ld: '/Users/nickmowen/Library/Android/flutter/bin/cache/artifacts/engine/ios/Flutter.framework/Flutter' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/nickmowen/Library/Android/flutter/bin/cache/artifacts/engine/ios/Flutter.framework/Flutter' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

最佳答案

这对我有用。

项目 -> build设置 -> 启用位码 设置为“否”

Image

https://stackoverflow.com/questions/55214735/

相关文章:

architecture - flutter BLoC : Is using nested Stre

flutter - 了解 Flutter didChangeDependencies 机制

dart - 如何在 Flutter/Dart 中将参数从命令行传递到 main?

flutter - 在 Android Studio 中运行和热重载 flutter 的问题(坏状态

google-maps - 自定义 Flutter Google Map 中的中心位置按钮

android - 在 Flutter 的垂直列表中添加动态高度水平 ListView

dart - 使用键和值从 map 创建小部件列表

dart - 如何根据背景图像更改文本颜色 - Flutter

authentication - 如何在 Flutter 应用中集成 Azure AD SSO

flutter - 在 Flutter 中监听设备方向变化