Content indexed through CSSearchableIndex.default().indexSearchableItems() is no longer searchable from Spotlight.
I created a very small app to demonstrate this. CSSearchableIndex.default().indexSearchableItems() returned no error, yet the result can't be found.
import CoreSpotlight
import SwiftUI
@main
struct testspotlightApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.onContinueUserActivity(CSSearchableItemActionType, perform: handleSpotlight)
}
}
func handleSpotlight(_ userActivity: NSUserActivity) {
print("Found \(userActivity.userInfo?.debugDescription ?? "nothing")")
}
}
import CoreSpotlight
import SwiftUI
struct ContentView: View {
@State var result = ""
var body: some View {
VStack {
Text("Hello!")
Button {
let attribute = CSSearchableItemAttributeSet(contentType: .text)
attribute.title = "a page title"
attribute.contentDescription = "hello this is a page"
attribute.keywords = ["search", "this", "page", "title"]
let item = CSSearchableItem(
uniqueIdentifier: "12345", domainIdentifier: "com.test", attributeSet: attribute)
CSSearchableIndex.default().indexSearchableItems([item]) { error in
if let error {
result = "Failed to index: \(error.localizedDescription)"
} else {
result = "Successefully indexed to spotlight. Try searching 'a page title'"
}
}
} label: {
Text("Index a page").font(.title)
}
Text(result).multilineTextAlignment(.center)
}
.padding()
}
}
Has anyone else seen the same issue?
Post not yet marked as solved
After upgrading Xcode to 14.2, when running or testing the project, sometimes I get this error:
"Could not launch Simulator.app."
Details
Could not launch Simulator.app.
Domain: DVTiPhoneSimulatorErrorDomain
Code: 1
User Info: {
DVTErrorCreationDateKey = "2023-01-25 17:34:08 +0000";
IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;
}
--
The operation couldn’t be completed. (OSStatus error -10827.)
Domain: NSOSStatusErrorDomain
Code: -10827
--
Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
"device_model" = "iPhone12,5";
"device_osBuild" = "16.0 (20A360)";
"device_platform" = "com.apple.platform.iphonesimulator";
"launchSession_schemeCommand" = Run;
"launchSession_state" = 1;
"launchSession_targetArch" = arm64;
"operation_duration_ms" = 120;
"operation_errorCode" = 1;
"operation_errorDomain" = DVTiPhoneSimulatorErrorDomain;
"operation_errorWorker" = IDELaunchiPhoneSimulatorLauncher;
"operation_name" = IDERunOperationWorkerGroup;
"param_consoleMode" = 0;
"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_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_memoryGraphOnResourceException" = 0;
"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_stopOnIssue" = 0;
"param_diag_showNonLocalizedStrings" = 0;
"param_diag_viewDebugging_enabled" = 1;
"param_diag_viewDebugging_insertDylibOnLaunch" = 1;
"param_install_style" = 0;
"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_runnable_type" = 2;
"param_testing_launchedForTesting" = 0;
"param_testing_suppressSimulatorApp" = 0;
"param_testing_usingCLI" = 0;
"sdk_canonicalName" = "iphonesimulator16.2";
"sdk_osVersion" = "16.2";
"sdk_variant" = iphonesimulator;
}
--
System Information
macOS Version 13.1 (Build 22C65)
Xcode 14.2 (21534) (Build 14C18)
For running the app, restarting the simulator fixes the problem, but soon it will happen again, so I have to keep restarting the simulator all the time. For unit tests, restarting the simulator also doesn't fix the problem, and this error shows up after a long time out.
Is anyone else seeing the same issue?
Post not yet marked as solved
Following yesterdsay's iOS 13 release we are seeing a large amount of crash in SiriTTS:Crashed: com.twitter.crashlytics.ios.exception
0 {app name} 0x102c2d890 CLSProcessRecordAllThreads + 454980
1 {app name} 0x102c2dc78 CLSProcessRecordAllThreads + 455980
2 {app name} 0x102c1d4f0 CLSHandler + 388516
3 {app name} 0x102c2be94 __CLSExceptionRecord_block_invoke + 448328
4 libdispatch.dylib 0x188009088 + 20
5 libdispatch.dylib 0x188015880 + 60
6 {app name} 0x102c2b900 CLSExceptionRecord + 446900
7 {app name} 0x102c2b3e4 CLSTerminateHandler() + 445592
8 {app name} 0x1055faec8 CPPExceptionTerminate() + 179 (KSCrashMonitor_CPPException.cpp:179)
9 libc++abi.dylib 0x188121634 + 20
10 libc++abi.dylib 0x188120f58 + 34
11 libc++abi.dylib 0x188120f10 __cxa_throw + 126
12 SiriTTS 0x18b0bbe7c + 964
13 SiriTTS 0x18b0bc390 + 152
14 SiriTTS 0x18b1265c8 + 44
15 SiriTTS 0x18b08d8ec + 304
16 SiriTTS 0x18b1064d0 + 68
17 SiriTTS 0x18b1063e0 + 48
18 SiriTTS 0x18b106380 + 56
19 SiriTTS 0x18b106310 + 52
20 SiriTTS 0x18b103b3c + 164
21 SiriTTS 0x18b103a68 + 64
22 SiriTTS 0x18b0aa4c0 + 488
23 SiriTTS 0x18b0ab608 + 1148
24 SiriTTS 0x18b0a5540 + 532
25 SiriTTS 0x18b0a56b4 + 192
26 TTSSpeechBundle 0x11f48c234 (Missing)
27 TTSSpeechBundle 0x11f49d720 (Missing)
28 TTSSpeechBundle 0x11f49d7cc (Missing)
29 TTSSpeechBundle 0x11f49ac24 (Missing)
30 TTSSpeechBundle 0x11f49c238 (Missing)
31 TTSSpeechBundle 0x11f49abd8 (Missing)
32 libsystem_pthread.dylib 0x18806cd60 _pthread_start + 128
33 libsystem_pthread.dylib 0x188074c88 thread_start + 8Has anyone seen something similar?We cannot reproduce, but we are seeing a large number of crash reports in Fabric.