gpt4 book ai didi

iOS - 无法链接主可执行文件(版本)?

转载 作者:行者123 更新时间:2023-12-02 00:05:19 25 4
gpt4 key购买 nike

我最近将 XCode 更新到了 V 11.1,自从更新以来,由于某种原因,当我在 Release模式下运行我的应用程序时,我抛出了以下错误:

ld: can't link with a main executable file '/Users/me/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Products/Release-iphoneos/myapp.app/myapp' for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

我完全不知道如何解决这个问题 - 如果没有它,我就无法在 Release模式下运行我的应用程序(是的,我正在使用分发配置文件)。非常感谢您的帮助。我浏览了其他一些答案,但似乎没有一个能解决这个问题。

当我导航到该文件路径时,“myapp”只是一个带有圆圈和斜线的图标(这不是一个好兆头)。即使我清理构建文件夹后也会发生同样的情况。当我尝试在 Release模式下重建时,构建失败并再次抛出上述内容。

查看完整错误:

Ld /Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Intermediates.noindex/myapp.build/Release-iphoneos/myappTests.build/Objects-normal/armv7/Binary/myappTests normal armv7 (in target 'myappTests' from project 'myapp') cd /Users/admin/Desktop/myapp /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target armv7-apple-ios8.4 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.1.sdk -L/Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Products/Release-iphoneos -F/Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Products/Release-iphoneos -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.1.sdk/Developer/Library/Frameworks -F/Users/admin/Desktop/myapp/Pods/FirebaseAnalytics/Frameworks -F/Users/admin/Desktop/myapp/Pods/GoogleAppMeasurement/Frameworks -F/Users/admin/Desktop/myapp/Pods/GoogleMaps/Base/Frameworks -F/Users/admin/Desktop/myapp/Pods/GoogleMaps/Maps/Frameworks -F/Users/admin/Desktop/myapp/Pods/GooglePlaces/Frameworks -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks -filelist /Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Intermediates.noindex/myapp.build/Release-iphoneos/myappTests.build/Objects-normal/armv7/myappTests.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -bundle_loader /Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Products/Release-iphoneos/myapp.app/myapp -Xlinker -object_path_lto -Xlinker /Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Intermediates.noindex/myapp.build/Release-iphoneos/myappTests.build/Objects-normal/armv7/myappTests_lto.o -fobjc-arc -fobjc-link-runtime -lc++ -licucore -lsqlite3 -lz -framework Accelerate -framework CFNetwork -framework CoreData -framework CoreGraphics -framework CoreImage -framework CoreLocation -framework CoreTelephony -framework CoreText -framework Foundation -framework GLKit -framework ImageIO -framework OpenGLES -framework QuartzCore -framework Security -framework StoreKit -framework SystemConfiguration -framework UIKit -framework XCTest -lPods-myappTests -Xlinker -dependency_info -Xlinker /Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Intermediates.noindex/myapp.build/Release-iphoneos/myappTests.build/Objects-normal/armv7/myappTests_dependency_info.dat -o /Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Intermediates.noindex/myapp.build/Release-iphoneos/myappTests.build/Objects-normal/armv7/Binary/myappTests

ld: can't link with a main executable file '/Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Products/Release-iphoneos/myapp.app/myapp' for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

最佳答案

终于找到了解决我的问题的方法。希望这个答案对其他人有帮助。

Product > Scheme > Edit Scheme, and then tap the 'Build' category on the left hand side.

Under your appTests targets, uncheck "Run".

问题已解决。

关于iOS - 无法链接主可执行文件(版本)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58510630/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com