Random iOS CloudKit crashes during development - ios

My app uses CloudKit and includes the following line of very basic of code:
self.cloudContainer = CKContainer.defaultContainer()
During development and debugging with Xcode, it will randomly crash on that line of code with the following exception:
*** Terminating app due to uncaught exception 'CKException', reason: 'The application is missing required entitlement com.apple.developer.icloud-services'
If I just run it again from Xcode with no changes, it may run fine or it will crash again.
I've filed a radar on the problem and, as requested by Apple, sent them my .entitlements file and crash logs. They've said the entitlements look fine but no response on a solution or workaround.
Has anyone else seen this or have a suggestion to get around it? It really makes CloudKit development difficult.

Related

How to debug "Error acquiring assertion" with CloudKit database subscription for mac-catalyst app?

I have a working native iPhone/iPad app that I’m now trying to also do as a Mac Catalyst app. Everything seems to working, except when I enter something on the iOS version, it "breaks" the macOS version – I’m using CloudKit and CloudKit subscriptions to listen to changes in database.
I get this into the log 3 times:
2020-04-25 09:58:35.612887+0300 MyApp[2871:206093] [assertion] Error acquiring assertion: <NSError: 0x600000d4cb40; domain: RBSAssertionErrorDomain; code: 2; reason: "Specified target process does not exist">
2020-04-25 09:58:35.613919+0300 MyApp[2871:206093] [assertion] Error acquiring assertion: <NSError: 0x600000d4d290; domain: RBSAssertionErrorDomain; code: 2; reason: "Specified target process does not exist">
2020-04-25 09:58:35.615102+0300 MyApp[2871:206093] [assertion] Error acquiring assertion: <NSError: 0x600000d4de00; domain: RBSAssertionErrorDomain; code: 2; reason: "Specified target process does not exist">
The behaviour is really strange. The macOS version doesn’t actually crash, but the main window disappears and I have to rebuild it in XCode the run it again. I’ve tried adding breakpoints etc to the notifications flow, but there’s nothing that catches so I’m really stumped. None of the usual application methods are called when the notification is received. The same problem appears in debug mode, both with simulator and device, and also in production.
Really hoping to get some pointers, where/how to debug this kind of a problem. I’ve checked the system logs and cannot find anything there either.
Just ran into this myself, and eventually figured it out: you probably have more than one instance of the app (with that bundle ID) on your machine, and the push notification service is trying to spin up the wrong binary to deliver the notifications.
Since Catalyst apps get nuked if they try to open multiple instances, this background launch kills the app you're running in the debugger.
In my case, I had the App Store version of the app installed in /Applications (before I started adding CloudKit), and my current dev binary in my Xcode build root.
Hope that helps!

iOS Wikitude SDK crash on exit/reopen app

I've developed a simply app for iOS and Augmented Reality (with WikitudeSDK).
All go fine, but when I exit and reopen the app, at times the app crashes with the following message:
Assertion failure in -[WTGCDDriver createSharedContextWithId:], /Users/emperor/Development/Tools/Jenkins/Master/Instance/jobs/architect_sdk_builder/workspace/repositories/ios_core_services/src/Rendering/Driver/WTDriver.mm:71
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: _context'
Have you any idea of this?
Thanks.
For some reason the OpenGL context is null when you reopen your app; you receive this error because we seem to have forgotten to disable assertions for a public build. So thanks for making us aware of this oversight.
With respect to the actual issue, I cannot provide an answer without having more of an insight into what exactly your app is doing and which version and configuration of the SDK you are using.
I'd therefore like you to create a thread in the Wikitude forums which provides a platform that is better suited for assisting you with this issue than Stack Overflow is.

App Crashes after Project and Scheme Renames Xcode 8 Swift 2.3

After renaming my Xcode project, scheme, and target, my app crashes at the App Delegate when running in simulator. It should be noted that the app could be run successfully, without any errors, prior to the rename. I have attempted all manner of fixes including editing the project.pbxproj file, all to no avail. The app crashes with an "libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)" error at Thread 1 main.
Any assistance solving the problem would be greatly appreciated.

Irritating and confusing hosted applinks issue on iOS

All my hosted facebook applinks used to parse in my app using the bolts framework fine. I go to sleep, wake up and now none of my hosted applinks parse and my app crashes when trying to parse them using the bolts framework.
I have even tested a legacy build of my app on an older device which is archived and has previously passed my test spec's and even that now crashes? Is anyone else experiencing issues parsing hosted facebook applinks on iOS via the bolts framework?
Error message:
Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized
selector sent to instance 0x37419830'
We had that same issue yesterday, but it disappeared by itself. Seems like Facebook might have pushed a fix already.
All the new links are working fine, and the ones that were broken are working after a reinstallation of the Facebook App (might have been cached by the app).

AVAnimator crashes on device

I integrated the AVAnimator in my project to display video with transparent background.
On the simulator everything works perfectly fine. I can see the video, the background really is transparent and I can hear the audio.
But when I try to build and run on the device I get following error:
Assertion failure in -[SegmentedMappedData mapSegment], /transparentVideoTest/AVAnimator/SegmentedMappedData.m:300
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'mmap result EINVAL'
I'm not so familiar with mmap.
Can anyone tell me what the reason could be, when the mapping works on simulator but not on device?
I had the same problem. I solved it by going into Build Settings and changing the allowed architecture to be $(ARCHS_STANDARD_32_BIT) (Try to match your project settings to those of an AVAnimator example project )

Resources