添加 URL 方案会导致 Xcode 崩溃

Jor*_*ter 7 url xcode info.plist ios

我试图通过转到 Target \xe2\x86\x92 Info \xe2\x86\x92 URL Types 来在我的 Xcode 项目中添加新的 URL 方案。然而,每次我尝试这样做时,Xcode 都会崩溃。我同事的笔记本也出现了这个问题,网上也找不到任何关于这个问题的信息。对于我们的其他 Xcode 项目,当我们执行相同的步骤时,Xcode 不会崩溃。我已经检查了所有项目构建设置,但找不到任何与其他项目明显不同的内容。

\n

Info.plist的相关部分:

\n
<key>CFBundleURLTypes</key>\n<array>\n    <dict>\n        <key>CFBundleTypeRole</key>\n        <string>Editor</string>\n        <key>CFBundleURLSchemes</key>\n        <array>\n            <string>com.googleusercontent.apps.408909143945-rchlbbmomfh9qh99n6rpmgem3mjhmf9h</string>\n        </array>\n    </dict>\n</array>\n
Run Code Online (Sandbox Code Playgroud)\n

直接编辑 Info.plist 文件来添加方案是可行的,但它也应该通过 Xcode 本身来工作(它不应该崩溃)。我们在应用程序中看到 URL 出现奇怪的行为(AppDelegate 方法在应该调用时没有被调用),这可能与此问题有关 - 也许是项目配置设置或类似的东西。

\n

完整的 Xcode 崩溃详细信息(如果有用):

\n
Translated Report (Full Report Below)\nProcess: Xcode [1516] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 14.3 (21812) Build Info: IDEFrameworks-21812000000000000~3 (14E222b) App Item ID: 497799835 App External ID: 855820377 Code Type: ARM-64 (Native) Parent Process: launchd [1] User ID: 501\nDate/Time: 2023-05-03 17:33:55.8846 +0200 OS Version: macOS 13.3.1 (22E772610a) Report Version: 12 Anonymous UUID: E1F9FAB3-74AA-9387-B8D9-CFC697705C5E\nTime Awake Since Boot: 1300 seconds\nSystem Integrity Protection: enabled\nCrashed Thread: 0 Dispatch queue: com.apple.main-thread\nException Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000\nApplication Specific Information: abort() called\nApplication Specific Signatures: NSInvalidArgumentException\nApplication Specific Backtrace 0: 0 CoreFoundation 0x000000019e5ef19c __exceptionPreprocess + 176 1 DVTFoundation 0x0000000104483d84 DVTFailureHintExceptionPreprocessor + 392 2 libobjc.A.dylib 0x000000019e10e4d4 objc_exception_throw + 60 3 Foundation 0x000000019f56d2cc +[NSDirectorySubpathsOperation directorySubpathsOperationAtPath:] + 0 4 Xcode3UI 0x0000000138ef2ec0 -[Xcode3InfoEditorIconNameProvider listContents] + 384 5 Foundation 0x000000019f4c0110 -[NSObject(NSKeyValueCoding) valueForKey:] + 320 6 Foundation 0x000000019f4bff78 -[NSObject(NSKeyValueCoding) valueForKeyPath:] + 220 7 Foundation 0x000000019f4bff78 -[NSObject(NSKeyValueCoding) valueForKeyPath:] + 220 8 Foundation 0x000000019f526bcc -[NSDictionary(NSKeyValueCoding) valueForKeyPath:] + 404 9 Foundation 0x000000019f4bff78 -[NSObject(NSKeyValueCoding) valueForKeyPath:] + 220 10 Foundation 0x000000019f4bff78 -[NSObject(NSKeyValueCoding) valueForKeyPath:] + 220 11 IDEKit 0x0000000107e7f534 __IDEInspectorSingleValueForKeyPath_block_invoke_2 + 144 12 IDEKit 0x0000000107e7edac IDEInspectorEnumerateContent + 424 13 IDEKit 0x0000000107e7f39c IDEInspectorSingleValueForKeyPath + 244 14 IDEKit 0x0000000107bb7fb0 -[IDEInspectorListProperty refresh] + 140 15 IDEKit 0x0000000107ba457c -[IDEInspectorProperty performRefresh] + 208 16 IDEKit 0x0000000107ba2da0 __65-[IDEInspectorProperty initWithPropertyDefinition:andController:]_block_invoke + 16 17 DVTFoundation 0x00000001042d4160 -[DVTDelayedInvocation runBlock:] + 204 18 IDEKit 0x0000000107e49018 -[IDEInspectorPropertyLayoutGroup refreshIfNeeded] + 64 19 IDEKit 0x0000000107e44c60 -[IDEInspectorLayoutGroup refreshIfNeeded] + 164 20 IDEKit 0x0000000107e44c60 -[IDEInspectorLayoutGroup refreshIfNeeded] + 164 21 IDEKit 0x0000000107e44c60 -[IDEInspectorLayoutGroup refreshIfNeeded] + 164 22 IDEKit 0x0000000107e44c60 -[IDEInspectorLayoutGroup refreshIfNeeded] + 164 23 IDEKit 0x0000000107e44c60 -[IDEInspectorLayoutGroup refreshIfNeeded] + 164 24 IDEKit 0x0000000107e44c60 -[IDEInspectorLayoutGroup refreshIfNeeded] + 164 25 IDEKit 0x0000000107e44c60 -[IDEInspectorLayoutGroup refreshIfNeeded] + 164 26 IDEKit 0x0000000107e44c60 -[IDEInspectorLayoutGroup refreshIfNeeded] + 164 27 IDEKit 0x0000000107e40a1c -[IDEInspectorContentView layoutTopDown] + 40 28 DVTStructuredLayoutKit 0x0000000103cec0c4 +[DVTStructuredLayoutViewCoordinator sendConfigureSubviewsToView:populatingLaidOutLayoutViews:] + 164 29 DVTStructuredLayoutKit 0x0000000103cec344 -[DVTStructuredLayoutViewCoordinator recursivelyLayoutSubviewsOfView:populatingVisitedViews:populatingVisitedLayoutViewsInTopDownOrder:populatingLaidOutLayoutViews:currentLayoutPass:needsSecondPass:] + 256 30 DVTStructuredLayoutKit 0x0000000103cec5b8 __199-[DVTStructuredLayoutViewCoordinator recursivelyLayoutSubviewsOfView:populatingVisitedViews:populatingVisitedLayoutViewsInTopDownOrder:populatingLaidOutLayoutViews:currentLayoutPass:needsSecondPass:]_block_invoke + 196 31 DVTFoundation 0x0000000104483a10 DVTInvokeWithFailureHintProvider + 76 32 DVTStructuredLayoutKit 0x0000000103cec424 -[DVTStructuredLayoutViewCoordinator recursivelyLayoutSubviewsOfView:populatingVisitedViews:populatingVisitedLayoutViewsInTopDownOrder:populatingLaidOutLayoutViews:currentLayoutPass:needsSecondPass:] + 480 33 DVTStructuredLayoutKit 0x0000000103cec5b8 __199-[DVTStructuredLayoutViewCoordinator recursivelyLayoutSubviewsOfView:populatingVisitedViews:populatingVisitedLayoutViewsInTopDownOrder:populatingLaidOutLayoutViews:currentLayoutPass:needsSecondPass:]_block_invoke + 196 34 DVTFoundation 0x0000000104483a10 DVTInvokeWithFailureHintProvider + 76 35 DVTStructuredLayoutKit 0x0000000103cec424 -[DVTStructuredLayoutViewCoordinator recursivelyLayoutSubviewsOfView:populatingVisitedViews:populatingVisitedLayoutViewsInTopDownOrder:populatingLaidOutLayoutViews:currentLayoutPass:needsSecondPass:] + 480 36 DVTStructuredLayoutKit 0x0000000103cec5b8 __199-[DVTStructuredLayoutViewCoordinator recursivelyLayoutSubviewsOfView:populatingVisitedViews:populatingVisitedLayoutViewsInTopDownOrder:populatingLaidOutLayoutViews:currentLayoutPass:needsSecondPass:]_block_invoke + 196 37 DVTFoundation 0x0000000104483a10 DVTInvokeWithFailureHintProvider + 76 38 DVTStructuredLayoutKit 0x0000000103cec424 -[DVTStructuredLayoutViewCoordinator recursivelyLayoutSubviewsOfView:populatingVisitedViews:populatingVisitedLayoutViewsInTopDownOrder:populatingLaidOutLayoutViews:currentLayoutPass:needsSecondPass:] + 480 39 DVTStructuredLayoutKit 0x0000000103cec5b8 __199-[DVTStructuredLayoutViewCoordinator recursivelyLayoutSubviewsOfView:populatingVisitedViews:populatingVisitedLayoutViewsInTopDownOrder:populatingLaidOutLayoutViews:currentLayoutPass:needsSecondPass:]_block_invoke + 196 40 DVTFoundation 0x0000000104483a10 DVTInvokeWithFailureHintProvider + 76 41 DVTStructuredLayoutKit 0x0000000103cec424 -[DVTStructuredLayoutViewCoordinator recursivelyLayoutSubviewsOfView:populatingVisitedViews:populatingVisitedLayoutViewsInTopDownOrder:populatingLaidOutLayoutViews:currentLayoutPass:needsSecondPass:] + 480\n
Run Code Online (Sandbox Code Playgroud)\n