Why "add Push notification feature to your app id" warning even after push-notification showing enabled in App ID?

IosXcodePush NotificationApple Push-NotificationsIos10

Ios Problem Overview


I am using Xcode8, swift 3, iOS 10

In Targets -> capabilities showing "add the Push notification feature to your app id".

I check my APP ID and it is showing pushnotfication enabled in both development and distribution.

With same APP IS and certificate I am getting notification in iOS9 but in iOS 10 i am getting error

Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo={NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}  

and also showing red mark (issue)

Ios Solutions


Solution 1 - Ios

I restarted XCode and it was gone :-)

Solution 2 - Ios

Close Xcode -> reopen -> clean -> build -> run.

Fixed the issue for me. Xcode 9.0.

Solution 3 - Ios

Sadly I quit xcode then installed the .mobileprovision (double clicking it) then restarted xcode and the warning was gone...Followed the other answer here by SteMa

Solution 4 - Ios

This happened to me. For some reason xCode signed me out. The fix: Tap Xcode (top bar) -> select Preferences -> select your Apple Id -> Sign-in. Hope this helps someone!

Solution 5 - Ios

In my case it does not help restarting xcode again.

I just restart system and that problem was gone.

Solution 6 - Ios

After I enabled push for my app, I had to regenerate my provisioning profiles and re-download them for Xcode to recognized the aps attribute.

Solution 7 - Ios

In my situation I went to here enter image description here & here enter image description here

under the general tab in xCode settings and reset my bundle identifier to a different name and it fixed the certificates and everything worked!

Obviously if you need the same bundle identifier you will need to go with some of the other suggestions here, but use this if all else fails.

Solution 8 - Ios

In my case, none of the above answers worked. I had to generate new certificates. Xcode >> Preferences... >> Accounts >> select team >> Manage Certificates... >> + >> iOS Development >> repeat + >> iOS App Store.

Solution 9 - Ios

IF you have enabled Push notification ,your old Provisioning profile become inactive . Edit that old Provisioning profile and download fresh one , then try to generate the build .

Solution 10 - Ios

Check Info.plist -> Bundle identifier and establish it as YourProject -> Targets -> General -> Bundle identifier. Work for me

Solution 11 - Ios

Change your developer account in Xcode, because of APNS certificates developer account and Xcode developer account must be same.

--> Go to Target

--> Go to General Tab

--> GO to Signing

--> Select Team, Which account you used to develop APNS certificates.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNew iOS DevView Question on Stackoverflow
Solution 1 - IosSteMaView Answer on Stackoverflow
Solution 2 - IosDBITView Answer on Stackoverflow
Solution 3 - Iossam kView Answer on Stackoverflow
Solution 4 - IosGary ManstedView Answer on Stackoverflow
Solution 5 - Ioston1View Answer on Stackoverflow
Solution 6 - IosSandy ChapmanView Answer on Stackoverflow
Solution 7 - IosJoseph AstrahanView Answer on Stackoverflow
Solution 8 - IosCodeicusView Answer on Stackoverflow
Solution 9 - IosChandramaniView Answer on Stackoverflow
Solution 10 - IosIvanView Answer on Stackoverflow
Solution 11 - IosNareshView Answer on Stackoverflow