title: UIActivityViewController and presentViewController generating numerous errors
body: <p>I recently came encountered an error with UIActivityViewController in developing in objective-c running under IOS 15.4.1 that used to work. In fact, I copied the below code form one app (where it worked) to another (where it stopped working) generating a number of errors below. On a physical device, the activity controller (for airdrop and others) pops up and then immediately pops down when these errors appear with no chance to interact. There are no issues on the Xcode Simulator and it works fine. Any suggestions would be appreciated.</p>
  <p>-- Objective-C Code --</p>
  <pre><code>// create a message
  
  NSString *theMessage = @&quot;Some text we're sharing with an activity controller&quot;;
  
  NSArray *items = @[theMessage];
  
  // build an activity view controller
  
  UIActivityViewController *controller = [[UIActivityViewController alloc]initWithActivityItems:items applicationActivities:nil];
  
  // and present it
  
  [self presentViewController:controller animated:NO completion:^{
  </code></pre>
  <p>--- Error Log ---</p>
  <p>2022-04-21 14:01:53.986049-0400 myapp[29328:1429870] shareText Some text we're sharing with an activity controller
  2022-04-21 14:01:54.149992-0400 myapp[29328:1429870] [Default] Task myapp[29328]/1#4 LF=0 couldn't find entitlement CopresenceCore.Entitlement.publicAPI error nil
  2022-04-21 14:01:54.410315-0400 myapp[29328:1429870] [Default] Task myapp[29328]/1#4 LF=0 couldn't find entitlement CopresenceCore.Entitlement.publicAPI error nil
  2022-04-21 14:01:54.587110-0400 myapp[29328:1429870] [default] LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 &quot;process may not map database&quot; UserInfo={NSDebugDescription=process may not map database, _LSLine=264, _LSFunction=-[_LSDReadClient getServerStoreWithCompletionHandler:]}
  2022-04-21 14:01:54.587209-0400 myapp[29328:1429870] [default] Attempt to map database failed: permission was denied. This attempt will not be retried.
  2022-04-21 14:01:54.587282-0400 myapp[29328:1429870] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 &quot;process may not map database&quot; UserInfo={NSDebugDescription=process may not map database, _LSLine=264, _LSFunction=-[_LSDReadClient getServerStoreWithCompletionHandler:]}
  2022-04-21 14:01:54.620054-0400 myapp[29328:1429870] [default] -imageForImageDescriptor: can do IO please adopt -imageForDescriptor: for IO free drawing or -prepareImageForDescriptor: if IO is allowed. (This will become a fault soon.)
  2022-04-21 14:01:54.631883-0400 myapp[29328:1429870] [LayoutConstraints] Changing the translatesAutoresizingMaskIntoConstraints property of a UICollectionReusableView that is managed by a UICollectionView is not supported, and will result in incorrect self-sizing. View: &lt;_UIActivityContentFooterView: 0x1091b0670; baseClass = UICollectionReusableView; frame = (20 288; 374 52); layer = &lt;CALayer: 0x2813a09c0&gt;&gt;
  2022-04-21 14:01:54.647215-0400 myapp[29328:1429870] [default] LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 &quot;process may not map database&quot; UserInfo={NSDebugDescription=process may not map database, _LSLine=264, _LSFunction=-[_LSDReadClient getServerStoreWithCompletionHandler:]}
  2022-04-21 14:01:54.647308-0400 myapp[29328:1429870] [default] Attempt to map database failed: permission was denied. This attempt will not be retried.
  2022-04-21 14:01:54.647381-0400 myapp[29328:1429870] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 &quot;process may not map database&quot; UserInfo={NSDebugDescription=process may not map database, _LSLine=264, _LSFunction=-[_LSDReadClient getServerStoreWithCompletionHandler:]}
  2022-04-21 14:01:54.647627-0400 myapp[29328:1429870] [default] -imageForImageDescriptor: can do IO please adopt -imageForDescriptor: for IO free drawing or -prepareImageForDescriptor: if IO is allowed. (This will become a fault soon.)
  2022-04-21 14:01:55.226089-0400 myapp[29328:1429870] shareText: presentViewController completed
  2022-04-21 14:01:55.761911-0400 myapp[29328:1430040] [ShareSheet] connection invalidated</p>