I am using Android Studio version 2.1.2, and I am trying to implement Google Cloud Messaging to my app.
To be able to do that I hav
There's a great support article about this here by Android Studio.
Why are there two?
Which one should I edit to change my final package name
The package name in Gradle will overwrite the package name in the Manifest. So you should change it in Gradle.
If you would like to actually change the structure of your project, then you'd need to change your packagename in Manifest.xml
For permissions
In your particular case, the permissions, you ask which package name you should provide for Google Messaging. Since Google Messaging requires your final package name, you should enter your gradle packagename. If you're using flavours, you should do this dynamically as suggested by @alim's answer.