1

I am using Base localization with Xcode 7.0.1 in a swift ios project.

When trying to add a localized version of Info.plist, Xcode crashes reproducibly.

The crash report reads:

Process:               Xcode [8668]
Path:                  /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:            com.apple.dt.Xcode
Version:               7.0.1 (8228)
Build Info:            IDEFrameworks-8228000000000000~5
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Xcode [8668]
User ID:               501

Date/Time:             2016-02-09 20:19:34.068 +0100
OS Version:            Mac OS X 10.11.3 (15D21)
Report Version:        11
Anonymous UUID:        3E9F29CA-3434-1E64-B82C-450C0F5950BA

Sleep/Wake UUID:       E7AE7A3F-2138-4C7B-8C65-D550B9D39594

Time Awake Since Boot: 17000 seconds
Time Since Wake:       8500 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
ProductBuildVersion: 7A1001
UNCAUGHT EXCEPTION (NSInvalidArgumentException): *** -[NSPathStore2 stringByAppendingPathExtension:]: nil argument
UserInfo: (null)
Hints: None
Backtrace:
  0  0x00007fff96b1baca __exceptionPreprocess (in CoreFoundation)
  1  0x0000000100452734 DVTFailureHintExceptionPreprocessor (in DVTFoundation)
  2  0x00007fff8ddf973c objc_exception_throw (in libobjc.A.dylib)
  3  0x00007fff96b1b98d +[NSException raise:format:] (in CoreFoundation)
  4  0x00007fff8b42ce6b -[NSPathStore2 stringByAppendingPathExtension:] (in Foundation)
  5  0x0000000108cec86c -[Xcode3VariantGroup proposedFilePathForLocalization:fileType:] (in DevToolsCore)
  6  0x000000011228ec8c -[Xcode3LocalizationCommands addLocalizedResourceWithDefaultLocale:variantGroup:inspectorLocale_locale:inspectorLocale_fileDataType:conversionFileDataType:fileDataType:allowsConversion:operationCompletionBlock:] (in Xcode3UI)
  7  0x0000000112269c80 -[Xcode3LocalizationsInspector addResourceForInspectorLocale:] (in Xcode3UI)
  8  0x000000011226b598 -[Xcode3LocalizationsInspector tableView:setObjectValue:forTableColumn:row:] (in Xcode3UI)
  9  0x00007fff8f1cbd69 -[NSTableView _tryCellBasedMouseDown:atRow:column:withView:] (in AppKit)
 10  0x00007fff8f1546c2 -[NSTableView mouseDown:] (in AppKit)
 11  0x00007fff8f656d1d -[NSWindow _handleMouseDownEvent:isDelayedEvent:] (in AppKit)
 12  0x00007fff8f657fad -[NSWindow _reallySendEvent:isDelayedEvent:] (in AppKit)
 13  0x00007fff8efb0735 -[NSWindow sendEvent:] (in AppKit)
 14  0x00000001018ae31e -[IDEWorkspaceWindow sendEvent:] (in IDEKit)
 15  0x00007fff8eface49 -[NSApplication sendEvent:] (in AppKit)
 16  0x0000000101664ae9 -[IDEApplication sendEvent:] (in IDEKit)
 17  0x00007fff8eee003a -[NSApplication run] (in AppKit)
 18  0x00007fff8ee62520 NSApplicationMain (in AppKit)
 19  0x00007fff965c75ad start (in libdyld.dylib)

abort() called

Application Specific Signatures:
NSInvalidArgumentException

Application Specific Backtrace 1:
0   CoreFoundation                      0x00007fff96b1bae2 __exceptionPreprocess + 178
1   DVTFoundation                       0x0000000100452734 DVTFailureHintExceptionPreprocessor + 194
2   libobjc.A.dylib                     0x00007fff8ddf973c objc_exception_throw + 48
3   CoreFoundation                      0x00007fff96b1b98d +[NSException raise:format:] + 205
4   Foundation                          0x00007fff8b42ce6b -[NSPathStore2 stringByAppendingPathExtension:] + 113
5   DevToolsCore                        0x0000000108cec86c -[Xcode3VariantGroup proposedFilePathForLocalization:fileType:] + 470
6   Xcode3UI                            0x000000011228ec8c -[Xcode3LocalizationCommands addLocalizedResourceWithDefaultLocale:variantGroup:inspectorLocale_locale:inspectorLocale_fileDataType:conversionFileDataType:fileDataType:allowsConversion:operationCompletionBlock:] + 621
7   Xcode3UI                            0x0000000112269c80 -[Xcode3LocalizationsInspector addResourceForInspectorLocale:] + 681
8   Xcode3UI                            0x000000011226b598 -[Xcode3LocalizationsInspector tableView:setObjectValue:forTableColumn:row:] + 1183
9   AppKit                              0x00007fff8f1cbd69 -[NSTableView _tryCellBasedMouseDown:atRow:column:withView:] + 1992
10  AppKit                              0x00007fff8f1546c2 -[NSTableView mouseDown:] + 4507
11  AppKit                              0x00007fff8f656d1d -[NSWindow _handleMouseDownEvent:isDelayedEvent:] + 6322
12  AppKit                              0x00007fff8f657fad -[NSWindow _reallySendEvent:isDelayedEvent:] + 212
13  AppKit                              0x00007fff8efb0735 -[NSWindow sendEvent:] + 517
14  IDEKit                              0x00000001018ae31e -[IDEWorkspaceWindow sendEvent:] + 156
15  AppKit                              0x00007fff8eface49 -[NSApplication sendEvent:] + 2540
16  IDEKit                              0x0000000101664ae9 -[IDEApplication sendEvent:] + 739
17  AppKit                              0x00007fff8eee003a -[NSApplication run] + 796
18  AppKit                              0x00007fff8ee62520 NSApplicationMain + 1176
19  libdyld.dylib                       0x00007fff965c75ad start + 1

I am wondering if this might be a problem that the project configuration is inducing as I'm using cocoapods and some custom build script to fetch some resources at build time. Yet, I do not see any problems that would explain this.

Is there a way to fix this by ourselves or is it copypasta on the filesystem and hoping that Xcode will pick up on the changes?

Possibly caused by this is: after enabling base localization for Info.plist, the project refuses to build:

error: could not read data from '/Users/[redacted]/git/[redacted]-ios/[redacted]/Info.plist': The file “Info.plist” couldn’t be opened because there is no such file.

This does not surprise me, because xcode moved the file into Base.lproj.

Vvk
  • 4,031
  • 29
  • 51
Tobi Nary
  • 4,566
  • 4
  • 30
  • 50
  • Are you sure the Info.plist is in that path? – John Bennedict Lorenzo Feb 10 '16 at 08:39
  • Yes. `ls` lists it, git has it there and `cat` can show it. Pretty sure. – Tobi Nary Feb 10 '16 at 08:44
  • You should not localize `info.plist` file, it should always be in the project folder. Instead, you can add localizations to specific key of `Info.plist`, which is described here - http://stackoverflow.com/questions/25736700/how-to-localise-a-string-inside-the-ios-info-plist-file/25736915#25736915. Move your `Info.plist` back to the project folder, and delete the all the localizations to make your project compile. You should delete the localized copies from xcode. – Fahri Azimov Feb 10 '16 at 08:46
  • Why would xcode offer to localize it then? -.- Is there a safe way to reverse the localization w/o xcode crashing? Moving the file back does not work as described in my other question I linked to. – Tobi Nary Feb 10 '16 at 08:50
  • 1
    Make sure you have deleted the localized version of the `Info.plist`, and you have it in the project folder, it's referenced in the project files in the xcode. Now, go to the `Build Settings` of the target, and make sure `Info.plist File` is pointing to the right `Info.plist` that you have in your project. – Fahri Azimov Feb 10 '16 at 09:08

0 Answers0