xcode错误整理

1.(转载)在真机上运行时出现Could not launch "XXX" failed to get the task for process xxxx

在Xcode下编译工程正常,在模拟器下运行正常,最后在真机上运行的时候出现了如下错误:

Could not launch "FeedMeWorms" failed to get the task for process 3118



原因是:我的签名是distribution certificate,即发布者证书,不允许在真机上直接运行

使用开发者证书就OK了

注:在实际解决问题的时候,证书换了也不行,看网上说证书刷新,重启xcode等。没招了,只能刷新证书,重启xcode,最后到重启机器才行。

2.(转载)在真机运行时出现“A valid provisioning profile for this executable was not found.”

“A valid provisioning profile for this executable was not found.”

在开发时真机测试遇到这个问题,原因是因为之前发布过应用,在target的code signing中的code signing identity已经置为iphone Distribution发布状态,改为iphone Developer就ok了。

3.(转载)在真机运行程序的时候提示“Could not launch 'app name'”,No such file or directory (/Users/apple/Library/Developer/Xcode/DerivedData/mytest-ejkagqxooxgmtdfsdoygtyzflibe/Build/Products/Debug-iphoneos/mytest.app/mytest)

此问题一般不是程序本身问题,而是xcode问题

解决方式如下:

先退出xcode,再把/Users/apple/Library/Developer/Xcode/DerivedData/下面的东西都删除(DerivedData本身不要删),再启动xcode,再rebuild.

这个目录直接在xcode中,.app的文件show in filder。往上几个目录便是。还有xcode一定要退出啊

4.

#if ! __has_feature(objc_arc)

#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).

#endif

这个文件必须使用ARC(Automatic Reference Counting),你在.m的compiler flags中添加-fobjc-arc就可以了.
在TARGETS-Compile Source


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值