由于Apple链接器错误,应用程序重命名后单元测试无法运行 [英] Unit tests failing to run after app rename due to apple linker error

查看:178
本文介绍了由于Apple链接器错误,应用程序重命名后单元测试无法运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近更改了我的应用程序的名称,现在我的单元测试没有运行,我收到Apple链接器错误。



任何想法如何解决这个问题?如果我在Xcode中扩展我的'Products'文件夹,则有2个文件:



MyApp.app
MyAppTests.octest [显示为红色]



更新:删除所有构建文件夹(派生数据)仍然无效!


Ld
/Users/my/Library/Developer/Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Products/Debug-iphonesimulator/companyDesignerTests.octest/companyDesignerTests
normal i386
cd / Users / my / Documents / Working / companyDesigner
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr / bin:/ bin:/ usr / sbin:/ sbin
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang
-arch i386 -bundle -isysroot / Developer / Platforms / iPhoneSimulator.platform / Developer / SDKs / iPhoneSimulator5.0.sdk
-L ​​/ Users / my / Library / Developer / Xcode / DerivedData / srStudio-bdkgu onwasdiazelguppliitkdox / Build / Products / Debug-iphonesimulator
-F / Users / my / Library / Developer / Xcode / DerivedData / srStudio-bdkguonwasdiazelguppliitkdox / Build / Products / Debug-iphonesimulator
-F / Developer / Platforms / iPhoneSimulator.platform / Developer / SDKs / iPhoneSimulator5.0.sdk / Developer / Library / Frameworks
-F / Developer / Platforms / iPhoneSimulator.platform / Developer / SDKs / iPhoneSimulator5.0.sdk / Developer / Library / Frameworks
-filelist /Users/my/Library/Developer/Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Intermediates/srStudio.build/Debug-iphonesimulator/companyDesignerTests.build/Objects-normal/i386/companyDesignerTests.LinkFileList
-mmacosx-version-min = 10.6 -bundle_loader/ Users / my / Library / Developer / Xcode / DerivedData / srStudio-bdkguonwasdiazelguppliitkdox / Build / Products / Debug-iphonesimulator / s
& r.app-Xlinker -objc_abi_version -Xlinker 2 -lxml2 -Xlinker
-no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED = 50000 -framework CoreData -framework CoreGraphics -framework Foundation -framework UIKit -framework SenTestingKit -o / Users / my / Library / Developer /Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Products/Debug-iphonesimulator/companyDesignerTests.octest/companyDesignerTests



ld:in
/ Users / my / Library / Developer / Xcode / DerivedData / srStudio -bdkguonwasdiazelguppliitkdox / Build / Products / Debug-iphonesimulator / s
& r.app,无法映射文件,errno = 22 for architecture i386命令
/ Developer /平台/ iPhoneSimulator.platform /开发人员的/ usr /斌/铛
失败,退出代码1



解决方案

我不知道这是否可以帮助您解决问题,但您可以尝试转到组织者,然后在项目标签下点击删除适用于所有派生数据


I recently changed the name of my app and now my unit tests are not running, I am getting an Apple linker error.

Any idea how to fix this? If I expand my 'Products' folder in Xcode there are 2 files:

MyApp.app MyAppTests.octest [which appears red]

Update: Deleted all the build folders (derived data) still doesn't work!

Ld /Users/my/Library/Developer/Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Products/Debug-iphonesimulator/companyDesignerTests.octest/companyDesignerTests normal i386 cd /Users/my/Documents/Working/companyDesigner setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -bundle -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/my/Library/Developer/Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Products/Debug-iphonesimulator -F/Users/my/Library/Developer/Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Products/Debug-iphonesimulator -F/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/Developer/Library/Frameworks -F/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/Developer/Library/Frameworks -filelist /Users/my/Library/Developer/Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Intermediates/srStudio.build/Debug-iphonesimulator/companyDesignerTests.build/Objects-normal/i386/companyDesignerTests.LinkFileList -mmacosx-version-min=10.6 -bundle_loader "/Users/my/Library/Developer/Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Products/Debug-iphonesimulator/s & r.app" -Xlinker -objc_abi_version -Xlinker 2 -lxml2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework CoreData -framework CoreGraphics -framework Foundation -framework UIKit -framework SenTestingKit -o /Users/my/Library/Developer/Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Products/Debug-iphonesimulator/companyDesignerTests.octest/companyDesignerTests

ld: in /Users/my/Library/Developer/Xcode/DerivedData/srStudio-bdkguonwasdiazelguppliitkdox/Build/Products/Debug-iphonesimulator/s & r.app, can't map file, errno=22 for architecture i386 Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1

解决方案

I don't know if this would help you solve your problem but you could try going to the organizer and under Projects tab hit remove for all Derived Data

这篇关于由于Apple链接器错误,应用程序重命名后单元测试无法运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆