Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6.1 crashes when trying to 'Export for localization'

I added localization to my project in Xcode 5.x and used the tools at hand at that time.

I have now added new strings and updated the storyboards so I need to update my translations. Therefore I tried to export my translation by using the menu "Editor | Export for localization...'. It brings up a dialog but when pressing Ok, Xcode presents an error for a second:

"/Applications/Xcode.app/Contents/Developer/usr/bin/extractLocStrings exited with status 1"

and then it crashes.

Any ideas why I cannot export the localization?

like image 704
Ole Bjørn Setnes Avatar asked Jan 15 '15 17:01

Ole Bjørn Setnes


2 Answers

I also had this problem and found that the easiest way to figure out which file is potentially the UTF-8 one if you have hundreds of files is to use the command line call:

xcodebuild -exportLocalizations -localizationPath <dirpath> -project <projectname> [[-exportLanguage <targetlanguage>]]

This will then give you a more helpful error:

Input file /path/to/your/file/filename.m cannot be read in UTF-8 encoding

xcodebuild: error: /Applications/Xcode.app/Contents/Developer/usr/bin/extractLocStrings exited with status 1

Hope that helps others :)

like image 139
snwbuni Avatar answered Sep 20 '22 12:09

snwbuni


I had the same problem: solved changing in a .m file the text enconding from western (Mac OS Roman) to UTF-8

like image 25
Alessandro Avatar answered Sep 21 '22 12:09

Alessandro