I am encountering this error when I am loading an Ad Hoc build of my Push Notification enabled iPhone app onto my device:
no valid aps-environment entitle
You have to enable Target—> capabilities—> push notification. I have faced this issue using Xcode 8.1.