此处,由于之前导入该图片是,导入的图片的引用,而不是拷贝,导致
从新从服务器下载代码后:
licrifandeMacBook-Pro:jiandao_ios crifan$ ls iOS-Client licrifandeMacBook-Pro:jiandao_ios crifan$ rm -rf iOS-Client/ licrifandeMacBook-Pro:jiandao_ios crifan$ ls licrifandeMacBook-Pro:jiandao_ios crifan$ git clone https://git.oschina.net/windoze/iOS-Client Cloning into ‘iOS-Client’… remote: Counting objects: 2604, done. remote: Compressing objects: 100% (2369/2369), done. remote: Total 2604 (delta 1107), reused 604 (delta 100) Receiving objects: 100% (2604/2604), 10.78 MiB | 2.43 MiB/s, done. Resolving deltas: 100% (1107/1107), done. Checking connectivity… done. licrifandeMacBook-Pro:jiandao_ios crifan$ pwd /Users/crifan/dev/tmp/jiandao_ios licrifandeMacBook-Pro:jiandao_ios crifan$ |
编译出错:
CpResource /Users/Documents/pic/develop_related/[email protected] /Users/crifan/Library/Developer/Xcode/DerivedData/JianDao-easwxibnmeicifbynozpzpqruiwm/Build/Products/Debug-iphonesimulator/JianDao.app/[email protected] cd /Users/crifan/dev/tmp/jiandao_ios/iOS-Client/JianDao export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/Documents/pic/develop_related/[email protected] /Users/crifan/Library/Developer/Xcode/DerivedData/JianDao-easwxibnmeicifbynozpzpqruiwm/Build/Products/Debug-iphonesimulator/JianDao.app error: /Users/Documents/pic/develop_related/[email protected]: No such file or directory |
但是此处,已经:
新增了对应的
assets了:
结果还是同样错误。。。
此时,可以看到图片有找不到:
结果去原始的项目中去看看,果然真的存在,对应的该图片的引用:
-》所以很简单,去删除该图片等引用
-》后续代码中调用到的图片,都是assets中的,就可以了。
-》assets中的图片,都是已经拷贝到项目中的,不会缺失了。
[总结]
当编译出现文件找不到
-》其中一种可能是:Xcode中在导入外部的图片或者其他类型文件的时候,
默认使用了引用,没有真的复制该文件到项目内
-》导致,其他人下载到代码后,无法编译,出现找不到文件
-》解决办法是:
重新删除该文件的引用,重新导入该文件,且选择是copy,而不是reference。
转载请注明:在路上 » [已解决]xcode编译出错:error: /Users/Documents/pic/develop_related/[email protected]: No such file or directory