简体   繁体   English

Apple Mach-O链接器错误。 链接器命令失败,退出代码为1

[英]Apple Mach-O Linker Error. Linker command failed with exit code 1

My App worked fine the last couple of days, but suddenly I get this error. 最近几天我的应用程序运行正常,但突然我收到了此错误消息。

I already tried these things: 我已经尝试过这些东西:

  • Restart Xcode & mac 重新启动Xcode和Mac
  • Clean Projects 清洁项目
  • Clean Derived Data Folder 清理衍生数据文件夹

Here is the error: 这是错误:

ld /Users/someuser/Library/Developer/Xcode/DerivedData/myapp-dohndrkqlwlrkeggboazluaanniz/Build/Products/Debug-iphonesimulator/sampleappTests.xctest/sampleappTests normal x86_64
    cd /Users/someuser/Development/Workspaces/2015/ios/myapp
    export IPHONEOS_DEPLOYMENT_TARGET=8.2
    export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -bundle -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk -L/Users/someuser/Library/Developer/Xcode/DerivedData/myapp-dohndrkqlwlrkeggboazluaanniz/Build/Products/Debug-iphonesimulator -F/Users/someuser/Library/Developer/Xcode/DerivedData/myapp-dohndrkqlwlrkeggboazluaanniz/Build/Products/Debug-iphonesimulator -F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk/Developer/Library/Frameworks -F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk/Developer/Library/Frameworks -filelist /Users/someuser/Library/Developer/Xcode/DerivedData/myapp-dohndrkqlwlrkeggboazluaanniz/Build/Intermediates/sampleapp.build/Debug-iphonesimulator/sampleappTests.build/Objects-normal/x86_64/sampleappTests.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -bundle_loader /Users/someuser/Library/Developer/Xcode/DerivedData/myapp-dohndrkqlwlrkeggboazluaanniz/Build/Products/Debug-iphonesimulator/myapp.app/myapp -Xlinker -objc_abi_version -Xlinker 2 -framework XCTest -L/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/someuser/Library/Developer/Xcode/DerivedData/myapp-dohndrkqlwlrkeggboazluaanniz/Build/Intermediates/sampleapp.build/Debug-iphonesimulator/sampleappTests.build/Objects-normal/x86_64/sampleappTests.swiftmodule -mios-simulator-version-min=8.2 -Xlinker -dependency_info -Xlinker /Users/someuser/Library/Developer/Xcode/DerivedData/myapp-dohndrkqlwlrkeggboazluaanniz/Build/Intermediates/sampleapp.build/Debug-iphonesimulator/sampleappTests.build/Objects-normal/x86_64/sampleappTests_dependency_info.dat -o /Users/someuser/Library/Developer/Xcode/DerivedData/myapp-dohndrkqlwlrkeggboazluaanniz/Build/Products/Debug-iphonesimulator/sampleappTests.xctest/sampleappTests

ld: file not found: /Users/someuser/Library/Developer/Xcode/DerivedData/myapp-dohndrkqlwlrkeggboazluaanniz/Build/Products/Debug-iphonesimulator/myapp.app/myapp
clang: error: linker command failed with exit code 1 (use -v to see invocation)

链接器标志

And here is one more warning 还有一个警告

ld: warning: linking against dylib not safe for use in application extensions: /Users/someuser/Library/Developer/Xcode/DerivedData/myapp-dsaagxaaoxqxgxcwdhubkhreboeb/Build/Products/Debug-iphonesimulator/Pods/Alamofire.framework/Alamofire

Removing the Checkbox for the Test-Targets fixed the problem. 删除“测试目标”复选框可解决此问题。

在此处输入图片说明

If you run into this problem with Cocoapods during unit testing, you can just add pods to your testing target and run pod update in the terminal. 如果您在单元测试期间遇到了Cocoapods的问题,则可以将Pod添加到测试目标中,然后在终端中运行pod update Here comes my example and it solves the problem: 这是我的示例,它可以解决问题:

target 'YourProject' do
    # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!

    # Pods for YourProject
    pod 'RAMAnimatedTabBarController', '~> 2.0.13'
    pod 'XLPagerTabStrip', '~> 7.0'
    pod 'ZFRippleButton'
    pod 'Alamofire', '~> 4.4'
    pod 'SWXMLHash', '~> 4.0.0'
    pod 'SQLite.swift', '~> 0.11.3'
    pod 'DZNEmptyDataSet'
    pod 'PKHUD', '~> 4.0'

    target 'YourProjectTests' do
        # inherit! :search_paths
        # Pods for testing
        pod 'RAMAnimatedTabBarController', '~> 2.0.13'
        pod 'XLPagerTabStrip', '~> 7.0'
        pod 'ZFRippleButton'
        pod 'Alamofire', '~> 4.4'
        pod 'SWXMLHash', '~> 4.0.0'
        pod 'SQLite.swift', '~> 0.11.3'
        pod 'DZNEmptyDataSet'
        pod 'PKHUD', '~> 4.0'
    end

    target 'YourProjectUITests' do
        inherit! :search_paths
        # Pods for testing
    end

end

After adding pods above, run pod update . 在上面添加了pod update之后,运行pod update

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 调试方案无法建立-Apple Mach-O链接器错误。 链接器命令失败,退出代码为1 - Debug scheme won't build - Apple Mach-O Linker Error. Linker command failed with exit code 1 “ Apple Mach-O链接器命令失败,退出代码为1” - “Apple Mach-O linker command failed with exit code 1” Xcode-Apple Mach-O链接器错误-更改xcode版本时,链接器命令失败,退出代码为1 - Xcode - Apple Mach-O Linker Error - Linker command failed with exit code 1 when change xcode version Apple Mach-O链接器错误-链接器命令失败,退出代码为1 - Apple Mach-O Linker Error - linker command failed with exit code 1 apple mach-o链接器错误链接器命令失败,退出代码为1(使用-v查看调用) - apple mach-o linker error linker command failed with exit code 1 (use -v to see invocation) Apple Mach-O链接器(ld)错误组clang:错误:链接器命令失败,退出代码为1(使用-v查看调用) - Apple Mach-O Linker (ld) Error Group clang: error: linker command failed with exit code 1 (use -v to see invocation) Apple Mach-O链接器错误代码1 - Apple Mach-O Linker Error Code 1 如何修复“ Apple Mach-O链接器错误组-铛:错误:链接器命令失败,退出代码为1(使用-v查看调用)”错误 - How to fix “Apple Mach-O Linker Error Group - clang: error: linker command failed with exit code 1 (use -v to see invocation)” Error GCM链接器命令失败,退出代码1:Apple-Mach-O链接器错误 - GCM linker command failed with exit code 1: Apple-Mach-O Linker Error Apple Mach-O Linker错误 - Apple Mach-O Linker error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM