Localizable.strings error - compiler says file is missing

大憨熊 提交于 2019-12-22 05:06:38

问题


I tried adding a Localizable.strings file and add some strings to test with, everything works fine.

However, when I try to add a localization things starts to get weird. I am able to add a localization (english and russian) and I can see in finder that the files are listed in the two folders; ru.lproj and en.lproj.

When I clean and build I get the following compilation error:

Copy .strings file Error
The file "Localizable.strings" couldn't be opened because there is no such file.

回答1:


Fixed it by a push in the right direction from this link provided by tiguero in the comment.

I looked further into the .pbxproj file and found this funky row, that looked fishy:

    6AAE55EC1551A42500C1F3F0 /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = "<group>"; };

I removed it, cleaned and rebuild. It is now replaced by the following line:

6AC473DC1624BF3E00503305 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6AC473DE1624BF3E00503305 /* Localizable.strings */; };

And it works!



来源:https://stackoverflow.com/questions/12808044/localizable-strings-error-compiler-says-file-is-missing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!