【问题标题】:Issues with adding today extension to flutter app将今天的扩展添加到颤振应用程序的问题
【发布时间】:2019-08-08 10:19:16
【问题描述】:

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

据我所知,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)

有什么办法可以解决这个问题吗?谢谢!

编辑:

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

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)

【问题讨论】:

  • 你会在你的代码中使用它们吗,因为默认情况下沙盒上不存在这些
  • 我在颤振代码中使用它们,但在今天的扩展中没有。我更新了新信息
  • 根据 Flutter SDK,它不支持位码。你不应该启用它。
  • @SachinVas 那么这是否意味着我不能使用今天的扩展程序(我认为这需要位码?)
  • 哪个目标给您带来 FMDB 错误?

标签: ios swift xcode flutter ios-extensions


【解决方案1】:

这对我有用。

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

Image

【讨论】:

  • 为启用位码添加了新的构建设置并设置为否,现在它可以工作了。谢谢。
【解决方案2】:

fresh添加Today Extension后,无需开启bitcode,只需在Target: Today Extension中设置overwrite即可:

  • LIBRARY_SEARCH_PATHS = "";
  • OTHER_LDFLAGS = "";或OTHER_LDFLAGS = "-ObjC";

可能需要明确DerivedData

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-02
    • 2020-09-03
    • 2019-04-29
    • 1970-01-01
    相关资源
    最近更新 更多