XCode 11.1 crashes when localizing intents

I'm trying to localize the intentdefinition file in my project, but XCode crashes every time.


I'm following these steps:

- Select the file in XCode, click the Localize button, and select to move the file to the Base localization (choosing other languages results in the same crash). At this point, the folder Base.lproj is created and the intentdefinition file is moved into that

- When I select the file again in XCode, I see the languages supported by my project, with the Base language ticked.

- If I tick any other language, XCode will crash. It will however create the lproj folder for that language, and create a copy of the intentdefinition file in it.

- After reopinging XCode and selecting the intentdefinition file, I see the languages with only Base ticked. If I tick the previous language again, it will prompt me to either re-use the existing file or overwrite it. Both choices result in a crash.


This is an old project, the intents have only just been added but the rest of the app was localized years ago. The languages I see (under Project info) are:

- Base

- English, deprecated - development language

- Dutch

- English

- French

- German

- Norwegian (Bokmal)

- Swedish


Others appear to have successfully localized their intents files. Any idea what could be causing this?

Replies

- If I tick any other language, XCode will crash. It will however create the lproj folder for that language, and create a copy of the

Does it occur with any file that is localized of just for intent files ?


May have a look here on the overall process for creating intentDefinition.


to localize, I often keep the original file as it is (in fact, it will be the base) and add languages (even the same as the Base).

It only happens with intent files. I've tried localizing a xib file and that worked fine, no issues.

So, try to create the intentDefinition file (follow the tutorial to be sure you include all that is needed).


Then select it and click localize.


Add another language (just one to start with), not changing the language of the existing file.

So, you will have Base and french for instance.


I'm surprised to see

- English, deprecated - development language


What has happened here ? Maybe it the change you mentioned "select to move the file to the Base localization"


Note: before localizing, make a copy of the complete project folder, in case…

I haven't been able to fix this, but I tried a workaround:


- Choose to localize the intentdefinition file.

- Select a second language for the intentdefinition file, and let XCode crash

- Reopen XCode

- Open Finder and locate the newly created intentdefinitoon file for the additional language

- Drag this file into the app extention folder in XCode. The intentdefinition file now has an arrow next to it, when expanding it, it will show the 2 versions of the file, one for each language. At this stage it's possible to localize the file for the 2nd language in XCode.


Visually, all appears to be in order. However I now get a compiler error:

Multiple commands produce '/Users/ronald/Library/Developer/Xcode/DerivedData/ZPanel-drelfkjiknijavarocdeprkhoclp/Build/Intermediates.noindex/ZPanel.build/Debug-iphonesimulator/HWShortcuts.build/DerivedSources/IntentDefinitionGenerated/HWShortcuts/FlipSwitchIntent.m':

1) Target 'HWShortcuts' (project 'ZPanel'): IntentDefinitionCodegen /Users/ronald/Documents/Projects/ZPanel/HWShortcuts/en.lproj/HWShortcuts.intentdefinition

2) Target 'HWShortcuts' (project 'ZPanel'): IntentDefinitionCodegen /Users/ronald/Documents/Projects/ZPanel/HWShortcuts/nl.lproj/HWShortcuts.intentdefinition


Other have reported that error as well. Checking this post, it appears that XCode is not supposed to generate a second intentsdefinition file, but instead split off the text into a separate strings file, which is then localized for each language. That's not happening in my case, and I'm not sure at this point how I can make XCode do this.

Did you do an option-clean build folder after copying the file in XCode ?


If not OK, you could try, instead of dragging the file into XCode, to create a new intentdefinition file in the project, via new File command (I did not test, hope that works).


At the end, file a bug report, if not already done.

Using Xcode 12.2 and this still happens. Xcode crashes if i tick another language.