使用舊版的Xcode創(chuàng)建project后,工程目錄里會生成一個Supporting Files文件夾,不過此文件夾只有組織路徑,在Finder中沒有實際路徑。
今天使用Xcode9.4創(chuàng)建project后,工程目錄不再自動生成Supporting Files文件夾了,為了項目文件目錄結(jié)構(gòu)的清晰,我自己在Finder里創(chuàng)建了Supporting Files文件夾,然后將info.plist和一些圖片資源的管理集,放入了此文件夾,編譯卻出現(xiàn)了以下錯誤
<ignore_js_op style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; outline: none; caret-color: rgb(68, 68, 68); color: rgb(68, 68, 68); font-family: "Microsoft yahei", 微軟雅黑, Arial, Helvetica, sans-serif, 宋體; font-size: 14px;">
image
</ignore_js_op>
出現(xiàn)這個問題的原因是因為這時info.plist的實際路徑變了,但組織路徑?jīng)]有充,導(dǎo)致編譯時找不到文件,再重新配置文件路徑就可以解決了。
解決方法:
TARGETS - 工程名 - Build Settings - Packaging - Info.plist,在后面輸入框中重新配置Supporting Files實際路徑,編譯成功。
其實,這時候編譯實際還有一個問題存在,那就是:The Copy Bundle Resources build phase contains this target's Info.plist
<ignore_js_op style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; outline: none; caret-color: rgb(68, 68, 68); color: rgb(68, 68, 68); font-family: "Microsoft yahei", 微軟雅黑, Arial, Helvetica, sans-serif, 宋體; font-size: 14px;">
image
</ignore_js_op>
這是一個警告,原因是 這是由于在Copy Bundle Resources(TARGETS->build phase)中添加了info.plist造成的。找到Copy Bundle Resources 把info.plist 去掉就可以了。