我在 Xcode 测试 iOS 18.4 新出的 Translation Provider ,按照 官方文档 添加了 entitlement 、access key 、app extension ,并创建了一个简单的 UI 。
但是启动 App 时出现报错。我是刚接触 iOS 开发没多久,麻烦大家帮忙看看是不是哪里配置有问题。
日志中 Invalid placeholder attributes
和 Failed to create promise
具体指什么?
是不是 entitlement 或者 Info.plist 的某些配置有问题?
这种问题一般该怎么排查?
希望有经验的朋友帮忙看看,非常感谢! 🙏
Simulator device failed to install the application.
Domain: IXErrorDomain
Code: 2
Failure Reason: Invalid placeholder attributes.
User Info: {
DVTErrorCreationDateKey = "2025-04-02 04:04:12 +0000";
FunctionName = "+[IXPlaceholder _placeholderForBundle:client:withParent:installType:metadata:placeholderType:mayBeDeltaPackage:isFromSerializedPlaceholder:error:]";
IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;
SimCallingSelector = "installApplication:withOptions:error:";
SourceFileLine = 981;
}
--
Failed to create app extension placeholder for /Users/eddiepeng/Library/Developer/Xcode/DerivedData/ExtensionTest-dceeplqjptdufuaucwddasmwjwxd/Build/Products/Debug-iphonesimulator/ExtensionTest.app/PlugIns/TranslationExtensionTest.appex
Domain: IXErrorDomain
Code: 2
Failure Reason: Failed to create promise.
User Info: {
FunctionName = "+[IXPlaceholder _placeholderForBundle:client:withParent:installType:metadata:placeholderType:mayBeDeltaPackage:isFromSerializedPlaceholder:error:]";
SourceFileLine = 981;
}
--
Failed to set placeholder attributes top.delta17.ExtensionTest.TranslationExtensionTest
Domain: IXErrorDomain
Code: 2
Failure Reason: Failed to create promise.
User Info: {
FunctionName = "+[IXPlaceholder _placeholderForBundle:client:withParent:installType:metadata:placeholderType:mayBeDeltaPackage:isFromSerializedPlaceholder:error:]";
SourceFileLine = 818;
}
--
extensionDictionary must be set in placeholder attributes for an app extension placeholder
Domain: IXErrorDomain
Code: 17
Failure Reason: Invalid placeholder attributes.
User Info: {
FunctionName = "-[IXPlaceholder setPlaceholderAttributes:error:]";
SourceFileLine = 1999;
}
--
Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : {
"device_identifier" = "FE4AA28E-B010-423E-9D5E-FFF66953A896";
"device_model" = "iPhone17,2";
"device_osBuild" = "18.4 (22E238)";
"device_platform" = "com.apple.platform.iphonesimulator";
"device_thinningType" = "iPhone17,2";
"dvt_coredevice_version" = "443.19";
"dvt_coresimulator_version" = "1010.10";
"dvt_mobiledevice_version" = "1784.102.1";
"launchSession_schemeCommand" = Run;
"launchSession_state" = 1;
"launchSession_targetArch" = arm64;
"operation_duration_ms" = 38;
"operation_errorCode" = 2;
"operation_errorDomain" = IXErrorDomain;
"operation_errorWorker" = IDELaunchiPhoneSimulatorLauncher;
"operation_name" = IDERunOperationWorkerGroup;
"param_debugger_attachToExtensions" = 0;
"param_debugger_attachToXPC" = 1;
"param_debugger_type" = 3;
"param_destination_isProxy" = 0;
"param_destination_platform" = "com.apple.platform.iphonesimulator";
"param_diag_113575882_enable" = 0;
"param_diag_MainThreadChecker_stopOnIssue" = 0;
"param_diag_MallocStackLogging_enableDuringAttach" = 0;
"param_diag_MallocStackLogging_enableForXPC" = 1;
"param_diag_allowLocationSimulation" = 1;
"param_diag_checker_tpc_enable" = 1;
"param_diag_gpu_frameCapture_enable" = 0;
"param_diag_gpu_shaderValidation_enable" = 0;
"param_diag_gpu_validation_enable" = 0;
"param_diag_guardMalloc_enable" = 0;
"param_diag_memoryGraphOnResourceException" = 0;
"param_diag_mtc_enable" = 1;
"param_diag_queueDebugging_enable" = 1;
"param_diag_runtimeProfile_generate" = 0;
"param_diag_sanitizer_asan_enable" = 0;
"param_diag_sanitizer_tsan_enable" = 0;
"param_diag_sanitizer_tsan_stopOnIssue" = 0;
"param_diag_sanitizer_ubsan_enable" = 0;
"param_diag_sanitizer_ubsan_stopOnIssue" = 0;
"param_diag_showNonLocalizedStrings" = 0;
"param_diag_viewDebugging_enabled" = 1;
"param_diag_viewDebugging_insertDylibOnLaunch" = 1;
"param_install_style" = 2;
"param_launcher_UID" = 2;
"param_launcher_allowDeviceSensorReplayData" = 0;
"param_launcher_kind" = 0;
"param_launcher_style" = 0;
"param_launcher_substyle" = 0;
"param_runnable_appExtensionHostRunMode" = 0;
"param_runnable_productType" = "com.apple.product-type.application";
"param_structuredConsoleMode" = 1;
"param_testing_launchedForTesting" = 0;
"param_testing_suppressSimulatorApp" = 0;
"param_testing_usingCLI" = 0;
"sdk_canonicalName" = "iphonesimulator18.4";
"sdk_osVersion" = "18.4";
"sdk_variant" = iphonesimulator;
}
--
System Information
macOS Version 15.3.2 (Build 24D81)
Xcode 16.3 (23785) (Build 16E140)
Timestamp: 2025-04-02T12:04:12+08:00