Xcode常见报错及解决方案

来源:互联网 发布:行知小学学区房 编辑:程序博客网 时间:2024/06/04 19:36

1. but did not return a nonzero exit code to indicate failure

解决方案
build settings -> compress PNG files -> NO


2. or disable bitcode for this target

解决方案
build settings -> enable bitcode -> NO


3. failed to get the task for process XXX

iOS真机调试程序,报以上错误信息
原因为证书问题,project和targets的证书都必须是开发证书,ADHOC的证书会出现此问题。

解决方案
将project和targets的Distribution改为Developement即可。


4. library not found for -

这通常是由于工程在编译时找不到需要的链接库而导致的。

解决方案
targets -> build settings -> Library Search Path
添加缺失链接库的所在文件夹的路径


5. App Transport Security has blocked a cleartext HTTP (http://)

iOS9 请求出现:
App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app‘s Info.plist file.

苹果在iOS9中将原http协议改成了https协议,使用 TLS1.2 SSL加密请求数据。

解决方案/** 在info.plist 加入key */<key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><true/></dict>

参考资料:

https://developer.apple.com/library/prerelease/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS9.html#//apple_ref/doc/uid/TP40016198-DontLinkElementID_13


6. xcode运行到真机报错 While reading xx.png pngcrush caught libpng

详见参考资料:

http://zfanxu.iteye.com/blog/1974113

0 0
原创粉丝点击