Discussion Forums  >  Crashes, Memory Warnings

Replies: 38    Views: 1083

jandcproductions
Lost but trying
Profile
Posts: 28
Reg: Mar 22, 2013
Lugoff
580
04/03/13 08:46 AM (11 years ago)

Google Cloud Messaging Problem (Push Notifications)

Hello. When I am testing my app, it asks if I want to receive push notifications. I click yes, and then an erro message pops up at the bottom and quickly goes away. It says something like "We cannot coommunicate with the GCM system. Please make sure the device is online and logged in to a google account." What would cause this? I have configred push notifications it BT with my API key and project ID...
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/03/13 09:00 AM (11 years ago)
Your device has to be logged into a Google account in order to receive Push Notifications. Go into Settings > Accounts, and you can set it up there. Mark
 
jandcproductions
Lost but trying
Profile
Posts: 28
Reg: Mar 22, 2013
Lugoff
580
like
04/03/13 09:08 AM (11 years ago)
just checked. I am logged into my google account. And this is happening on multiple phones
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/03/13 09:14 AM (11 years ago)
I think this probably means the Push Stuff isn't configured correctly in buzztouch for your app. I know I got the GCM API Key messed up when I initially configured mine. Do you have your device attached to Eclipse, so you can see the LogCat output?
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/03/13 09:45 AM (11 years ago)
May I suggest checking out the "Setting up Android Push Notifications with GCM and Buzztouch" guide at http://www.buzztouch.com/resources/ and do let me know if there is anything missing. Cheers, Alan
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/03/13 09:53 AM (11 years ago)
Yep, that's an excellent guide! I used it as well. One thing I don't think was clear, and perhaps it's not actually necessary, but I had to sign up for the GCM API in my Google Developer Account. But, again, not sure if that's necessary, as I was trying a whole bunch of stuff.
 
jvalley
Aspiring developer
Profile
Posts: 456
Reg: Feb 16, 2013
Green Bay,Wi
9,360
like
04/03/13 12:08 PM (11 years ago)
make sure you use the number key not the word key
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/03/13 12:21 PM (11 years ago)
Thanks Mark, I'll add that. Cheers, Alan
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
05/17/13 05:57 AM (10 years ago)
Hello, when I edit the BT_gcmConfig.java file, it says: "YOUR-GOOGLE-GCM-PROJECT-ID" Do I have to use the "Project ID" or the "Project Number" here? Thanks..
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
05/17/13 06:09 AM (10 years ago)
Project Number
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
05/17/13 06:17 AM (10 years ago)
Thanks Alan, but Im still having the same popup error that jandcproductions reported. Did you have this issue? do you know any possible reason? thanks :)
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/17/13 08:12 AM (10 years ago)
Things to double-check: * Your device/emulator is logged into your Google account * You have registered for the GCM service in your Google Developer Account * You created a project in Google, and got the Project number, and inserted it into the code Mark
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
05/17/13 08:33 AM (10 years ago)
Hi Mark, thanks for your help. 1. My phone has my gmail account linked, that means I can go to Google Play and download apps. I think that's what you mean, right? 2. What do you mean with "registered for GCM service"? I create my project following the very 4 first steps from this guide: http://developer.android.com/google/gcm/gs.html That means Im registered to use GCM? Im confused now.. 3. As I said, I've already created the project and get the Project Number. Also I've add it to my BT_gcmConfig.java file.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/17/13 08:43 AM (10 years ago)
Looks like you've hit most of them. You also need to continue on with "Enable the GCM Service" and "Obtaining an API Key." That key, and the project ID, need to be entered into the Push Notification section of your control panel. Make sure those are done, and report back! Mark
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
05/17/13 08:48 AM (10 years ago)
Yeah! I've already done those steps: "Enabling the GCM Service" "Obtaining an API Key" And also I've put the required details in my BT panel: the project number and the API key. Im testing my app on a Samsung mini Galaxy (GT-s5570I) on Design mode.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/17/13 08:59 AM (10 years ago)
OK. What does it say in LogCat when the device tries to register with GCM? That'll provide some important debug info.
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
05/17/13 09:16 AM (10 years ago)
Look at the attached images please :) http://postimg.org/gallery/3m55gnzi/ You can see the logCat, also my BT_gcmConfig.java file and my Google APIs console. In the logCat screenshot, I put 3 red marks because I dont know why it shows "YOUR-GOOGLE-GCM-PROJECT-ID" :/ Is everything ok?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/17/13 09:33 AM (10 years ago)
Well, I'm stuck. It's reporting an HTTP Error 400, which is a bad request. It appears to me that you have all the correct IDs and keys in place. I've contacted David @ buzztouch to see if he can help! Mark
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
05/17/13 09:38 AM (10 years ago)
Oh thanks so much Mark, I realy need to get this solved :( Let me know any news please! Thanks again dude!!
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/17/13 09:40 AM (10 years ago)
We'll get it...don't worry!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/17/13 09:40 AM (10 years ago)
HTTP 400, bad request could mean lots of stuff. I'll dig into this post in a few hours after some snooping around :-)
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
05/17/13 09:45 AM (10 years ago)
Sounds good guys :) thanks both of you!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/17/13 01:01 PM (10 years ago)
OK...not seeing anything wrong on the backend... "I dont know why it shows "YOUR-GOOGLE-GCM-PROJECT-ID" This makes me think you could be missing a key part of the setup. 1) In your local Android project, find and open BT_gcmConfig.java (Google Cloud Messaging configuration file). 2) Scroll down to line 42 or so and look for this: static final String SENDER_ID = "YOUR-GOOGLE-GCM-PROJECT-ID"; Replace "YOUR-GOOGLE-GCM-PROJECT-ID" with your actual GCM Project Number like: static final String SENDER_ID = "1234567"; Save. 3) Re-compile / re-launch your project. If you still get the HTTP 400 error in the console we'll need to figure out what URL is rejecting the request. I suspect this won't happen after you update your project number in the BT_gcmConfig.java file.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/17/13 01:12 PM (10 years ago)
Hi David, His BT_cgmConfig.java file actually looks fine. He posted them here: http://postimg.org/gallery/3m55gnzi/ Is it possible he's actually compiling a version of the file that doesn't have that info? @Imagenparaweb : Verify that in Eclipse, the file is correct and up-to-date. Do an F5 or Refresh to ensure. Then, Project...Clean to break any old links, and recompile. Mark
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/17/13 03:24 PM (10 years ago)
Ah, yup, didn't see that. Hmm...you're probably right then. If he added the Project Number in the gcm config like it shows, there's ZERO reason the app would show YOUR-GOOGLE-GCM-PROJECT-ID in the LogCat console. Remove and re-install app?
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
05/20/13 06:57 AM (10 years ago)
Oh :( I started Eclipse today and found a new problem in all of my projects.. The files from 'gen' projects folder have dissapeared automatically or when I "Clean" the projects.. So now, I have to find the solution to this problem :( BTW, I've tried a lot of solutions but I still can't make my R.java files get generated again. Do you know any possible solution? Thanks.
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
05/22/13 06:30 AM (10 years ago)
hey guys! I finally solved my last issue! :) I missed an upgrade on my SDK, it works normal now. I'll try one more time the GCM settings.
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
05/22/13 07:58 AM (10 years ago)
Ok, I created a new GCM project and a new API key. Also enabled Google Cloud Messaging for Android service. After that, I put the project number on my BT_gcmConfig.java file, and also I entered the new details in BT control panel. Then, 'Clean' and 'Refresh' the project on Eclipse and tried it on my phone. The popup window appers to accept push notifications. I hit 'yes' and the app crash. This is what I get: http://postimg.org/image/6e4wc94ff/ Also, here u have the logCat: http://postimg.org/image/svrmu17yl/ Thanks my friends.
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
05/23/13 07:35 AM (10 years ago)
Are u still there? :S
 
recoore
I hate code!
Profile
Posts: 73
Reg: Mar 01, 2013
Kingston
4,880
like
05/23/13 12:44 PM (10 years ago)
I am having the same problem as you Imagenparaweb....I followed the directions down to the last detail....push notification will just not work. I have self hosted BT..on a VPS.. I also open the ports:5223,2195,2196,443 and the app just crash after i accept push notification popup
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
05/24/13 04:50 AM (10 years ago)
We need some help here!
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
05/27/13 09:56 AM (10 years ago)
I have a new question.. Can I publish my app on Google Play and then configure the push notification service? If so, the users that had previously downloaded the app will be notified about the push notification service? Thanks!
 
recoore
I hate code!
Profile
Posts: 73
Reg: Mar 01, 2013
Kingston
4,880
like
05/28/13 12:06 AM (10 years ago)
I got it working...make sure u sync your gmail acc properly...make sure your device iS not saying. SYNC NOT ON. Also make sure ports 443,5223,2195,2296 is turned on
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
05/28/13 05:43 AM (10 years ago)
I've already check my gmail sync :/ Did you add anything in the manifest.xml file? and also.. what about those ports? where do I turn them on? Thanks.
 
recoore
I hate code!
Profile
Posts: 73
Reg: Mar 01, 2013
Kingston
4,880
like
05/28/13 12:13 PM (10 years ago)
i added nothing to the manifest file.....ask your server host to turn on those ports for you, they will affect the success of your push notification setup.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/28/13 12:32 PM (10 years ago)
Yep, having the ports open is absolutely essential. Send a support ticket request to your provider to have them turned on.
 
recoore
I hate code!
Profile
Posts: 73
Reg: Mar 01, 2013
Kingston
4,880
like
05/28/13 06:04 PM (10 years ago)
Turn on the port on your serverhost...
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
05/29/13 04:16 AM (10 years ago)
Yes, but Im not a self hosted.
 
Imagenparaweb
Aspiring developer
Profile
Posts: 121
Reg: Dec 13, 2011
Cordoba
1,210
like
05/31/13 05:49 AM (10 years ago)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.