superuserdo
superuserdo

Reputation: 1657

GCM not sending or receiving - Android

I have uploaded an .apk to the Play Store and have come across the following problem; The GCM is not sending or receiving notifications.

When I run the app from Android Studio, the GCM works fine. It sends and receives notifications. However when I download the release version of my app to my phone, the GCM does not work.

I have linked the sender ID in the Play Store, I have added both the release and debug SHA-1 finger prints in the console. I am unsure where else to look. The only thing I can think of is that I had to change the name of my package when I uploaded to Google Play Store and I am thinking that caused the problem because the release version of the app used to have a functioning GCM, now it doesn't.

I have updated the package name everywhere that I can think of. How do I get GCM to work again for the release version of my app?

Upvotes: 0

Views: 460

Answers (1)

ezaquarii
ezaquarii

Reputation: 1916

During our conversation we identified the problem - Proguard is probably obfuscating your code. Since Android does some reflection here and there, things may break.

You need to properly configure Proguard by adding appropriate exceptions, so it does not touch fragile fragments. For example, code that uses reflection will break if Proguard changes function of variable name.

Check this out - it says how to configure Progurad so it does not break Play Services:

http://developer.android.com/google/play-services/setup.html

Remember: you WILL hit this problem over and over again in the future. A lot of libraries require Proguard exceptions.

Upvotes: 1

Related Questions