CloudKit: Application has malformed entitlements

Hey,

For some reason I see crashes for my iOS app related to CloudKit entitlements.

The crash happens on start up and it says: "CKException - Application has malformed entitlements. Found value "*" for entitlement com.apple.developer.icloud-services, expected an array of strings"

I have checked my entitlements of the same build on App Store Connect and it shows "com.apple.developer.icloud-services: ( "CloudKit" )"

So I am not sure why users are having this issue. I haven't been able to reproduce it.

Does anyone have any idea why this is happening?

Thanks

Do you have symbolicated crash reports that you can share here? If your crash reports are sensitive, I’d suggest that you file a feedback report with them and share your report ID here.

An entitlement issue in the app would impact all users, which, as you've confirmed, is not your case, and so I am wondering if it is something on those specific user systems.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Hello Ziqiao,

Thanks so much for your reply.

I have attached a crash stack trace. Hope it helps.

# Crashlytics - Stack trace
# Application: com.na.istb
# Platform: apple
# Version: 1.27.6 (210)
# Issue: 355f1486bd7b3cbbac2a1a59f31026ac
# Session: b2cd6cf3482e45178aa4c151889ca3d5_DNE_0_v2
# Date: Thu Jan 16 2025 00:25:19 GMT-0500 (Eastern Standard Time)

Fatal Exception: CKException
Application has malformed entitlements. Found value "*" for entitlement com.apple.developer.icloud-services, expected an array of strings
0  CoreFoundation                 0x2d5ec __exceptionPreprocess
1  libobjc.A.dylib                0x31244 objc_exception_throw
2  CloudKit                       0x1365e8 _CKSQLDBSerializerUnlock
3  CloudKit                       0x136324 _CKSQLDBSerializerUnlock
4  libdispatch.dylib              0x3fa8 _dispatch_client_callout
5  libdispatch.dylib              0x57f4 _dispatch_once_callout
6  CloudKit                       0x13884 CKActivityCreate(_:dso:)
7  CloudKit                       0x1508d4 CKCurrentQueueQualityOfService
8  libdispatch.dylib              0x3fa8 _dispatch_client_callout
9  libdispatch.dylib              0x57f4 _dispatch_once_callout
10 CloudKit                       0xaa5c CKMainBundleIsAppleExecutable
11 CloudKit                       0x1d12dc CloudKit_Is_Slowing_Failing_Operations_Due_To_High_Error_Rate
12 CloudKit                       0x1c7034 CKStringFromShareParticipantSelfRemovalBehavior
13 iSTB                           0x1a6528 SyncOperation.createZone(recordZoneID:_:) + 838 (CloudSyncManager.swift:838)
14 iSTB                           0x1a3d38 SyncOperation.sync(startDate:forcecreateZoneAndSubscriptions:createZoneIfNotFound:recordZoneID:subscriptions:completion:) + 797 (CloudSyncManager.swift:797)
15 iSTB                           0x1b00e0 specialized SyncOperation.run(_:) + 745 (CloudSyncManager.swift:745)
16 iSTB                           0x1a1b38 CloudSyncManager.runSyncOperations() + 424 (CloudSyncManager.swift:424)
17 iSTB                           0x1a1904 CloudSyncManager.sync(context:category:) + 414 (CloudSyncManager.swift:414)
18 iSTB                           0x3036b4 specialized CloudSyncManager.init(fileManager:notificationCenter:db:accountStatus:isRestoringBackup:preferencesStorage:profileStorage:liveTVStorage:vodStorage:radioStorage:activityStorage:tracker:syncEnabled:syncImmediately:) + 390 (CloudSyncManager.swift:390)
19 iSTB                           0x2fd7b8 AppDelegate.getRootViewController() ()
20 iSTB                           0x42f88c specialized SceneDelegate.scene(_:willConnectTo:options:) + 31 (SceneDelegate.swift:31)
21 iSTB                           0x42f630 @objc SceneDelegate.scene(_:willConnectTo:options:) ()
22 ???                            0x188bb9054 (Missing)
23 ???                            0x188e71cd0 (Missing)
24 ???                            0x188c9ea00 (Missing)
25 ???                            0x188c9cfa0 (Missing)
26 FrontBoardServices             0xc00c __95-[FBSScene _callOutQueue_didCreateWithTransitionContext:alternativeCreationCallout:completion:]_block_invoke
27 FrontBoardServices             0x9834 -[FBSScene _callOutQueue_coalesceClientSettingsUpdates:]
28 FrontBoardServices             0xb794 -[FBSScene _callOutQueue_didCreateWithTransitionContext:alternativeCreationCallout:completion:]
29 FrontBoardServices             0x1fc94 __93-[FBSWorkspaceScenesClient _callOutQueue_sendDidCreateForScene:transitionContext:completion:]_block_invoke.197
30 FrontBoardServices             0x1f4c8 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:]
31 FrontBoardServices             0x2eb90 -[FBSWorkspaceScenesClient _callOutQueue_sendDidCreateForScene:transitionContext:completion:]
32 libdispatch.dylib              0x3fa8 _dispatch_client_callout
33 libdispatch.dylib              0x79f0 _dispatch_block_invoke_direct
34 FrontBoardServices             0x18378 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__
35 FrontBoardServices             0x182f8 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible]
36 FrontBoardServices             0x181d0 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource]
37 CoreFoundation                 0x73f3c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
38 CoreFoundation                 0x73ed0 __CFRunLoopDoSource0
39 CoreFoundation                 0x76b94 __CFRunLoopDoSources0
40 CoreFoundation                 0x75d2c __CFRunLoopRun
41 CoreFoundation                 0xc8274 CFRunLoopRunSpecific
42 GraphicsServices               0x14c0 GSEventRunModal
43 ???                            0x188e5e77c (Missing)
44 ???                            0x188a84e64 (Missing)
45 iSTB                           0x2ff5d0 main + 16 (AppDelegate.swift:16)
46 ???                            0x1ac4ecde8 (Missing)

Crashed: com.google.firebase.crashlytics.ios.exception
0  iSTB                           0x6ca058 FIRCLSProcessRecordAllThreads + 392 (FIRCLSProcess.c:392)
1  iSTB                           0x6ca43c FIRCLSProcessRecordAllThreads + 423 (FIRCLSProcess.c:423)
2  iSTB                           0x6d8670 FIRCLSHandler + 34 (FIRCLSHandler.m:34)
3  iSTB                           0x6d8470 __FIRCLSExceptionRecord_block_invoke + 240 (FIRCLSException.mm:240)
4  libdispatch.dylib              0x3fa8 _dispatch_client_callout + 20
5  libdispatch.dylib              0x137fc _dispatch_lane_barrier_sync_invoke_and_complete + 56
6  iSTB                           0x6d73cc FIRCLSExceptionRecord + 242 (FIRCLSException.mm:242)
7  iSTB                           0x6d7f28 FIRCLSExceptionRecordNSException + 126 (FIRCLSException.mm:126)
8  iSTB                           0x6d6fd4 FIRCLSTerminateHandler() + 407 (FIRCLSException.mm:407)
9  libc++abi.dylib                0x1287c std::__terminate(void (*)()) + 16
10 libc++abi.dylib                0x12820 std::terminate() + 108
11 libobjc.A.dylib                0x3f9d8 objc_terminate + 16
12 libdispatch.dylib              0x3fbc _dispatch_client_callout + 40
13 libdispatch.dylib              0x57f4 _dispatch_once_callout + 32
14 CloudKit                       0x13884 CKActivityCreate(_:dso:) + 12152
15 CloudKit                       0x1508d4 CKCurrentQueueQualityOfService + 104
16 libdispatch.dylib              0x3fa8 _dispatch_client_callout + 20
17 libdispatch.dylib              0x57f4 _dispatch_once_callout + 32
18 CloudKit                       0xaa5c CKMainBundleIsAppleExecutable + 64
19 CloudKit                       0x1d12dc CloudKit_Is_Slowing_Failing_Operations_Due_To_High_Error_Rate + 5012
20 CloudKit                       0x1c7034 CKStringFromShareParticipantSelfRemovalBehavior + 42036
21 iSTB                           0x1a6528 SyncOperation.createZone(recordZoneID:_:) + 838 (CloudSyncManager.swift:838)
22 iSTB                           0x1a3d38 SyncOperation.sync(startDate:forcecreateZoneAndSubscriptions:createZoneIfNotFound:recordZoneID:subscriptions:completion:) + 797 (CloudSyncManager.swift:797)
23 iSTB                           0x1b00e0 specialized SyncOperation.run(_:) + 745 (CloudSyncManager.swift:745)
24 iSTB                           0x1a1b38 CloudSyncManager.runSyncOperations() + 424 (CloudSyncManager.swift:424)
25 iSTB                           0x1a1904 CloudSyncManager.sync(context:category:) + 414 (CloudSyncManager.swift:414)
26 iSTB                           0x3036b4 specialized CloudSyncManager.init(fileManager:notificationCenter:db:accountStatus:isRestoringBackup:preferencesStorage:profileStorage:liveTVStorage:vodStorage:radioStorage:activityStorage:tracker:syncEnabled:syncImmediately:) + 390 (CloudSyncManager.swift:390)
27 iSTB                           0x2fd7b8 AppDelegate.getRootViewController() + 4348319672 (:4348319672)
28 iSTB                           0x42f88c specialized SceneDelegate.scene(_:willConnectTo:options:) + 31 (SceneDelegate.swift:31)
29 iSTB                           0x42f630 @objc SceneDelegate.scene(_:willConnectTo:options:) + 4349572656 (:4349572656)
30 ???                            0x188bb9054 (Missing)
31 ???                            0x188e71cd0 (Missing)
32 ???                            0x188c9ea00 (Missing)
33 ???                            0x188c9cfa0 (Missing)
34 FrontBoardServices             0xc00c __95-[FBSScene _callOutQueue_didCreateWithTransitionContext:alternativeCreationCallout:completion:]_block_invoke + 288
35 FrontBoardServices             0x9834 -[FBSScene _callOutQueue_coalesceClientSettingsUpdates:] + 68
36 FrontBoardServices             0xb794 -[FBSScene _callOutQueue_didCreateWithTransitionContext:alternativeCreationCallout:completion:] + 436
37 FrontBoardServices             0x1fc94 __93-[FBSWorkspaceScenesClient _callOutQueue_sendDidCreateForScene:transitionContext:completion:]_block_invoke.197 + 276
38 FrontBoardServices             0x1f4c8 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168
39 FrontBoardServices             0x2eb90 -[FBSWorkspaceScenesClient _callOutQueue_sendDidCreateForScene:transitionContext:completion:] + 468
40 libdispatch.dylib              0x3fa8 _dispatch_client_callout + 20
41 libdispatch.dylib              0x79f0 _dispatch_block_invoke_direct + 284
42 FrontBoardServices             0x18378 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 52
43 FrontBoardServices             0x182f8 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 240
44 FrontBoardServices             0x181d0 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 28
45 CoreFoundation                 0x73f3c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
46 CoreFoundation                 0x73ed0 __CFRunLoopDoSource0 + 176
47 CoreFoundation                 0x76b94 __CFRunLoopDoSources0 + 344
48 CoreFoundation                 0x75d2c __CFRunLoopRun + 840
49 CoreFoundation                 0xc8274 CFRunLoopRunSpecific + 588
50 GraphicsServices               0x14c0 GSEventRunModal + 164
51 ???                            0x188e5e77c (Missing)
52 ???                            0x188a84e64 (Missing)
53 iSTB                           0x2ff5d0 main + 16 (AppDelegate.swift:16)
54 ???                            0x1ac4ecde8 (Missing)

Thread
0  libsystem_kernel.dylib         0x1510 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x36cc _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1474 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1510 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x36cc _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1474 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1510 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x36cc _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1474 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1510 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x36cc _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1474 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1510 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x36cc _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1474 start_wqthread + 8

com.google.firebase.crashlytics.ios.binary-images
0  libsystem_kernel.dylib         0x5d20 write + 8
1  iSTB                           0x6db170 FIRCLSFileLoopWithWriteBlock + 253 (FIRCLSFile.m:253)
2  iSTB                           0x6db010 FIRCLSFileWriteToFileDescriptor + 228 (FIRCLSFile.m:228)
3  iSTB                           0x6db678 FIRCLSFileWriteStringWithSuffix + 309 (FIRCLSFile.m:309)
4  iSTB                           0x6db76c FIRCLSFileWriteHashEntryString + 556 (FIRCLSFile.m:556)
5  iSTB                           0x6c8300 FIRCLSProcessBinaryImageChange + 566 (FIRCLSBinaryImage.m:566)
6  libdispatch.dylib              0x3fa8 _dispatch_client_callout + 20
7  libdispatch.dylib              0xb5cc _dispatch_lane_serial_drain + 768
8  libdispatch.dylib              0xc124 _dispatch_lane_invoke + 380
9  libdispatch.dylib              0x1738c _dispatch_root_queue_drain_deferred_wlh + 288
10 libdispatch.dylib              0x16bd8 _dispatch_workloop_worker_thread + 540
11 libsystem_pthread.dylib        0x3680 _pthread_wqthread + 288
12 libsystem_pthread.dylib        0x1474 start_wqthread + 8

com.google.firebase.crashlytics.startup
0  libsystem_kernel.dylib         0x7bd0 __ulock_wait + 8
1  libdispatch.dylib              0x4998 _dlock_wait + 56
2  libdispatch.dylib              0x4694 _dispatch_wait_on_address + 140
3  libdispatch.dylib              0x4d68 _dispatch_group_wait_slow + 56
4  iSTB                           0x6ddbcc -[FIRCLSInstallIdentifierModel regenerateInstallIDIfNeededWithBlock:] + 132 (FIRCLSInstallIdentifierModel.m:132)
5  iSTB                           0x6d27b4 __91-[FIRCLSReportUploader prepareAndSubmitReport:dataCollectionToken:asUrgent:withProcessing:]_block_invoke + 97 (FIRCLSReportUploader.m:97)
6  iSTB                           0x6c78cc FIRCLSApplicationActivity + 231 (FIRCLSApplication.m:231)
7  iSTB                           0x6d26e4 -[FIRCLSReportUploader prepareAndSubmitReport:dataCollectionToken:asUrgent:withProcessing:] + 164 (FIRCLSReportUploader.m:164)
8  iSTB                           0x6ce3c4 __92-[FIRCLSExistingReportManager processExistingActiveReportPath:dataCollectionToken:asUrgent:]_block_invoke_2 + 244 (FIRCLSExistingReportManager.m:244)
9  Foundation                     0x5b70c __NSINDEXSET_IS_CALLING_OUT_TO_A_BOOL_BLOCK__ + 24
10 Foundation                     0x4af68 -[NSBlockOperation main] + 104
11 Foundation                     0x4ae88 __NSOPERATION_IS_INVOKING_MAIN__ + 16
12 Foundation                     0x492e0 -[NSOperation start] + 648
13 Foundation                     0x80750 __NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 16
14 Foundation                     0x80380 __NSOQSchedule_f + 172
15 libdispatch.dylib              0x13394 _dispatch_block_async_invoke2 + 148
16 libdispatch.dylib              0x3fa8 _dispatch_client_callout + 20
17 libdispatch.dylib              0xb5cc _dispatch_lane_serial_drain + 768
18 libdispatch.dylib              0xc124 _dispatch_lane_invoke + 380
19 libdispatch.dylib              0x1738c _dispatch_root_queue_drain_deferred_wlh + 288
20 libdispatch.dylib              0x16bd8 _dispatch_workloop_worker_thread + 540
21 libsystem_pthread.dylib        0x3680 _pthread_wqthread + 288
22 libsystem_pthread.dylib        0x1474 start_wqthread + 8

com.google.fira.worker
0  libsystem_kernel.dylib         0x72dc stat + 8
1  libsystem_kernel.dylib         0x72dc stat64 + 8
2  libsqlite3.dylib               0x16a58 sqlite3_finalize + 6632
3  libsqlite3.dylib               0x1600c sqlite3_finalize + 3996
4  libsqlite3.dylib               0x9c8c4 sqlite3_sourceid + 53896
5  libsqlite3.dylib               0x2cc20 sqlite3_step + 6432
6  libsqlite3.dylib               0x2b6c0 sqlite3_step + 960
7  iSTB                           0x207b00c -[APMSqliteStore columnsForTableWithName:error:] + 995084
8  iSTB                           0x207a8f4 -[APMSqliteStore validateTableWithName:requiredColumnNames:addOnColumns:error:] + 993268
9  iSTB                           0x207a3a0 -[APMSqliteStore ensureTableWithName:createSQL:requiredColumnNames:addOnColumns:error:] + 991904
10 iSTB                           0x2079858 -[APMSqliteStore ensureTableWithName:elementaryColumnInfo:addOnColumnInfo:error:] + 989016
11 iSTB                           0x2079fc0 -[APMSqliteStore ensureTableWithName:elementaryColumnInfo:addOnColumnInfo:modifyColumnInfo:error:] + 990912
12 iSTB                           0x1ffc738 -[APMDatabase ensureAllTables] + 476728
13 iSTB                           0x1ffb3a0 -[APMDatabase initializeDatabaseResourcesWithContext:databasePath:error:] + 471712
14 iSTB                           0x1ff28e4 -[APMDatabase initWithDatabaseName:persistedConfig:error:] + 436196
15 iSTB                           0x201b1e8 __47-[APMMeasurement startMeasurementOnWorkerQueue]_block_invoke + 602344
16 iSTB                           0x201af14 -[APMMeasurement startMeasurementOnWorkerQueue] + 601620
17 iSTB                           0x201a778 -[APMMeasurement setEnabledOnWorkerQueue:] + 599672
18 iSTB                           0x201a690 __29-[APMMeasurement setEnabled:]_block_invoke + 599440
19 iSTB                           0x2073364 __51-[APMScheduler scheduleOnWorkerQueueBlockID:block:]_block_invoke + 963172
20 libdispatch.dylib              0x2248 _dispatch_call_block_and_release + 32
21 libdispatch.dylib              0x3fa8 _dispatch_client_callout + 20
22 libdispatch.dylib              0xb5cc _dispatch_lane_serial_drain + 768
23 libdispatch.dylib              0xc124 _dispatch_lane_invoke + 380
24 libdispatch.dylib              0x1738c _dispatch_root_queue_drain_deferred_wlh + 288
25 libdispatch.dylib              0x16bd8 _dispatch_workloop_worker_thread + 540
26 libsystem_pthread.dylib        0x3680 _pthread_wqthread + 288
27 libsystem_pthread.dylib        0x1474 start_wqthread + 8

Thread
0  libsystem_kernel.dylib         0x1510 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x36cc _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x1474 start_wqthread + 8

com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x1788 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4e98 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4db0 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4bfc mach_msg + 24
4  CoreFoundation                 0x767f4 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x75ea0 __CFRunLoopRun + 1212
6  CoreFoundation                 0xc8274 CFRunLoopRunSpecific + 588
7  Foundation                     0x29b48 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
8  Foundation                     0x1866f4 -[NSRunLoop(NSRunLoop) runUntilDate:] + 64
9  ???                            0x188ef1b80 (Missing)
10 Foundation                     0x115a54 __NSThread__start__ + 724
11 libsystem_pthread.dylib        0x17d0 _pthread_start + 136
12 libsystem_pthread.dylib        0x1480 thread_start + 8

com.google.firebase.crashlytics.MachExceptionServer
0  libsystem_kernel.dylib         0x1788 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x4e98 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4db0 mach_msg_overwrite + 424
3  libsystem_kernel.dylib         0x4bfc mach_msg + 24
4  iSTB                           0x6d8c34 FIRCLSMachExceptionServer + 196 (FIRCLSMachException.c:196)
5  libsystem_pthread.dylib        0x17d0 _pthread_start + 136
6  libsystem_pthread.dylib        0x1480 thread_start + 8

Thanks, Nihal

Your crash report was generated by Crashlytics and doesn't quite help. If you can, please provide a symbolicated crash report generated by the system (as opposed to 3rd party crash reporters).

Also, please start with file a feedback report with the following information:

  • Your app name.
  • The app bundle you submitted to App Store.
  • One or more symbolicated crash reports generated by Apple's system.

After you file the report, please share the report ID here. I'd be interested in taking a look.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Hello Ziqiao,

How do I get crash reports by the system? As mentioned I am unable to reproduce the crash. So I am only able to see the crash in Crashlytic by my users.

Thanks, Nihal

Yeah, it's indeed quite troublesome given that you don't have a reproducible case, but here is what you can do:

  1. Disable or remove the 3rd party crash reporter from your app, and then create a new build. If you are curious why, the following post will give you more background: Implementing Your Own Crash Reporter.
  2. Install the CloudKit profile to your testing device.
  3. Test the new build on the device, until the crash happens.
  4. Gather a sysdiagnose from the device, as mentioned in Using a Sysdiagnose Log to Debug a Hard-to-Reproduce Problem.

The sysdiagnose should include the crash report, and also logs that may be helpful.

Just FYI, I am suspecting that the issue is something related to the 34018 error discussed here. Once you have a sysdiagnose, you can look into the system log to see if you can find the error.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

CloudKit: Application has malformed entitlements
 
 
Q