[CKContainer defaultContainer] crash

Hello all


We have recently added CloudKit support to our application. The software is live now and we are seeing

crash reports where [CKContainer defaultContainer] throws a CKException ('The application is missing

required entitlement com.apple.developer.icloud-services'). Only a fraction of all users seem to be affected

and we have not seen these problems on our own devices. The documentation of CKContainer states that

the function always returns a valid container object, exceptions are not mentioned. Since we always

initialize the cloud at startup of our application, the affected users can not use the application at all.


Does anyone know what could cause these problems? Can we work around the problem? We would at

least want to disable the cloud features when this problem happens. Presumably this would require us to

catch the exception?

Replies

Same issue for me 😟

Update: We have observed that the crash is only reported by the third party crash reporting software that we use (Fabric/Crashlytics). We don't find this type of crash in the XCode organizer. Furthermore we have not received reports from users related to this type of crash. So in the end we might have been fooled by the diagnostic tools.

More than one year later we brought out another app and observed the very same phenomenon. This time the crash count started to explode about two days after the launch of our new app. This lead us to a new hypothesis, namely that the crashes were caused by users attempting to start a badly cracked version of our game. It is possible that someone resigned our app without adding the entitlements found in the original app store version and did not bother to test the result. This indeed leads to the exact crash which was reported in the original post.

Thanks for the post.

This is what I was suspecting as well. Have you confirmed this is 100% true?

Seems a jailbreak issue. You can enclose the call in @try-catch block to avoid crash and then handle it appropriately.