NSFileProtectionComplete
isn't supported via entitlements anymore. Instead, it is specified in the provision profile.
I had the exact same problem you did. When I tried to build and run on a device, I got the following alert:
The executable was signed with invalid entitlements.
The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile.
(0xE8008016).
In the console, it manifested itself as this error:
May 6 16:18:13 XXXXX installd[54] : entitlement 'DataProtectionClass' has value not permitted by a provisioning profile
Eventually, I found the proper settings. You must log in to the developer portal and enable data protection on the app id associated with the provisioning profile you're using. See the image below: