Unable to Run App on Device

I recently moved an app from the original developer account to a new account. After doing this, I am no longer able to run the app on the device via Xcode. I'm still able to run it in the simulator and I can Archive it and upload it to iTunes Connect for either release in the App Store or testing via TestFlight.


When I try to run the app on my device directly in Xcode I get the following error. This happens after compiling and signing both finish successfully. This only happens when it tries to install the app onto the device to run it.


The executable was signed with invalid entitlements.

The entitlements specified in your application's Code Signing Entitlements file are invalid, not permitted, or do not match those specified in your provisioning profile. (0xE8008016).


I've tried removing all of the provisioning profiles and certificates from the developer portal. I currently have Xcode managing the signing automatically, but I get the same error when I turn off the automatic signing.


My entitlements file only has one entry: APS Environment which is a String set to development. I have tried setting it to production but it results in the exact same error.


I've done both a Clean and a Clean Build Folder without success.


I've verified that my iPhone is included in the list of checked devices in the provisioning profile and that my developer certificate is checked as well.


Today I made sure I was on the latest version of Xcode (8.3.2), macOS (10.12.5), and iOS (10.3.2).


Any ideas on how I can fix this problem? It's very difficult to debug an app when you can't run it on a device with the Xcode debugger.

Replies

Using your choice of iOS template, can you create a new project and build/run to that device no issues?

The entitlements specified in your application’s Code Signing Entitlements files are invalid, not permitted, or do not match those specified in your provisioning profile. (0xE8008016). I am also getting the same error while installing the app to device via xocde. kndly help to resolve my problem

I am getting this and the invalid provisioning profile on brand new apps in XCode after the Mojave update. I get this error on my iPhone 7 Plus and I get the invalid provisioning profile on my iPhone XS Max.

My problem arose after updating Mojave, as happened to @danield13


An easy solution for me was to create a new project and run it on my iPhone (iPhone 7 in my case). This somehow configured XCode, and allowed me run my project without the error of the entitlements