我用Flutter编写了一个应用,现在我想为其添加本机iOS扩展。我添加了小部件目标,但是当我尝试构建时,构建失败了,因为应用扩展目标无法找到特定的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)
有任何解决方法吗?谢谢!
编辑:
进入Pod并为其中的每个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)
答案 0 :(得分:0)
答案 1 :(得分:0)
fresh
添加了今日扩展后,无需启用位码,只需在overwrite
中进行Target: Today Extension
设置:
LIBRARY_SEARCH_PATHS
=“”;OTHER_LDFLAGS
=“”;或OTHER_LDFLAGS
=“ -ObjC”;
可能需要清除DerivedData