Flutter Xcode:clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

Posted

技术标签:

【中文标题】Flutter Xcode:clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)【英文标题】:Flutter Xcode: clang: error: linker command failed with exit code 1 (use -v to see invocation) 【发布时间】:2018-10-20 08:03:09 【问题描述】:

我在尝试构建 Xcode 时遇到此错误。我尝试删除派生数据并重新启动 Xcode,但没有任何帮助。

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

这是整个错误日志:

Ld /Users/chaythanyanair/Library/Developer/Xcode/DerivedData/Runner-efsxwbzqcezyswaezzytcnxazinn/Build/Products/Debug-iphonesimulator/Runner.app/Runner normal x86_64
    cd /Users/chaythanyanair/Documents/Qburst/Learn/flutter_poc/ios
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk -L/Users/chaythanyanair/Library/Developer/Xcode/DerivedData/Runner-efsxwbzqcezyswaezzytcnxazinn/Build/Products/Debug-iphonesimulator -L/Users/chaythanyanair/Documents/Qburst/Learn/flutter_poc/ios/Pods/EstimoteSDK -L/Users/chaythanyanair/Library/Developer/Xcode/DerivedData/Runner-efsxwbzqcezyswaezzytcnxazinn/Build/Products/Debug-iphonesimulator/Alamofire -L/Users/chaythanyanair/Library/Developer/Xcode/DerivedData/Runner-efsxwbzqcezyswaezzytcnxazinn/Build/Products/Debug-iphonesimulator/SwiftKeychainWrapper -L/Users/chaythanyanair/Library/Developer/Xcode/DerivedData/Runner-efsxwbzqcezyswaezzytcnxazinn/Build/Products/Debug-iphonesimulator/device_info -L/Users/chaythanyanair/Library/Developer/Xcode/DerivedData/Runner-efsxwbzqcezyswaezzytcnxazinn/Build/Products/Debug-iphonesimulator/flutter_secure_storage -L/Users/chaythanyanair/Library/Developer/Xcode/DerivedData/Runner-efsxwbzqcezyswaezzytcnxazinn/Build/Products/Debug-iphonesimulator/shared_preferences -L/Users/chaythanyanair/Documents/Qburst/Learn/flutter_poc/ios/Flutter -F/Users/chaythanyanair/Library/Developer/Xcode/DerivedData/Runner-efsxwbzqcezyswaezzytcnxazinn/Build/Products/Debug-iphonesimulator -F/Users/chaythanyanair/Documents/Qburst/Learn/flutter_poc/ios/Pods/EstimoteSDK/EstimoteSDK -F/Users/chaythanyanair/Documents/Qburst/Learn/flutter_poc/ios/Pods/../../../../flutter/flutter/bin/cache/artifacts/engine/ios -F/Users/chaythanyanair/Documents/Qburst/Learn/flutter_poc/ios/Flutter -filelist /Users/chaythanyanair/Library/Developer/Xcode/DerivedData/Runner-efsxwbzqcezyswaezzytcnxazinn/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/x86_64/Runner.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=8.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/chaythanyanair/Library/Developer/Xcode/DerivedData/Runner-efsxwbzqcezyswaezzytcnxazinn/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/x86_64/Runner_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/chaythanyanair/Library/Developer/Xcode/DerivedData/Runner-efsxwbzqcezyswaezzytcnxazinn/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/x86_64/Runner.swiftmodule -ObjC -lAlamofire -lSwiftKeychainWrapper -ldevice_info -lflutter_secure_storage -lshared_preferences -framework CoreBluetooth -framework CoreLocation -framework EstimoteSDK -framework Flutter -framework Foundation -framework MobileCoreServices -framework SystemConfiguration -framework UIKit -ObjC -lAlamofire -lSwiftKeychainWrapper -ldevice_info -lflutter_secure_storage -lshared_preferences -framework CoreBluetooth -framework CoreLocation -framework EstimoteSDK -framework Flutter -framework Foundation -framework MobileCoreServices -framework SystemConfiguration -framework UIKit -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/chaythanyanair/Library/Developer/Xcode/DerivedData/Runner-efsxwbzqcezyswaezzytcnxazinn/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Runner.app.xcent -lPods-Runner -Xlinker -dependency_info -Xlinker /Users/chaythanyanair/Library/Developer/Xcode/DerivedData/Runner-efsxwbzqcezyswaezzytcnxazinn/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/x86_64/Runner_dependency_info.dat -o /Users/chaythanyanair/Library/Developer/Xcode/DerivedData/Runner-efsxwbzqcezyswaezzytcnxazinn/Build/Products/Debug-iphonesimulator/Runner.app/Runner

我该如何解决这个问题?

【问题讨论】:

【参考方案1】:

我切换到主频道。

flutter channel master

然后运行

flutter upgrade

【讨论】:

然后有趣的flutter升级【参考方案2】:

对于 2020 年来到这里的人,我遇到了这个问题,运行了上面答案中的命令(flutter channel masterflutter upgrade),然后需要手动迁移我的 Xcode 项目以仍然使用新版本的扑。可在此处获取相关信息:https://flutter.dev/docs/development/ios-project-migration。希望对大家有所帮助。

【讨论】:

【参考方案3】:

这对我有用:

彻底删除ios文件夹 在终端中输入flutter create .

然后尝试flutter run 或在 android Studio 中按 Play。

【讨论】:

以上是关于Flutter Xcode:clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)的主要内容,如果未能解决你的问题,请参考以下文章

clang:错误:链接器命令失败,退出代码为 1(Unity 中的 XMPP 库导出了 xcode

xcode 中的错误:clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

Clang:错误:链接器命令失败,退出代码 1(使用 -v 查看调用)Xcode 10、Xcode 10.1 Beta、Swift 4.2

C ++ XCODE ld:未找到架构x86_64 clang的符号:错误:链接器命令失败,退出代码为1(使用-v查看调用)

ld:找不到-lIOKit.A clang xcode 的库

Objective-C clang:错误:链接器命令失败,退出代码为 1