-initWithDocumentTypes iCloud crashes only in production build

90 views Asked by At

I am using iCloud capabilities to choose files from iCloud by using UIDocumentMenuViewController. It is working fine in development build but whenever I upload build with production provisioning profile on Testflight my app produce a crash in line [[UIDocumentMenuViewController alloc] initWithDocumentTypes:@[@"public.data"] inMode:UIDocumentPickerModeImport];

I make archive in one machine and then create production build by using command-line on different machine.

I also checked the provisioning profile for production, and found all the capabilities are included under entitlement section.

Can someone help ?

1

There are 1 answers

0
Ankush On

Problem: As I was creating archive with command-line without code-signing (provisioning profile) system was ignoring the entitlements ad not creating the entitlements file (entitlement file archived-expanded-entitlements.xcent was not being created inside archive package or APP_NAME.xcarchive).

Solution: I wanted archived-expanded-entitlements.xcent file, so I created archive with Xcode by including provisioning profile and the package had the archived-expanded-entitlements.xcent file inside it. I copy this file everytime when I create archive by command-line without code signing. I copy this archived-expanded-entitlements.xcent file inside the archive package.

PS: If we change app capabilities we need to create new archived-expanded-entitlements.xcent as entitlements would changed.

Thanks everyone for your suggestion and comments :-)