xcode crash on adding localization for Info.plist with Base localization

痴心易碎 提交于 2019-12-11 13:25:41

问题


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.

来源:https://stackoverflow.com/questions/35300593/xcode-crash-on-adding-localization-for-info-plist-with-base-localization

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