Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8169329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:48:40+00:00 2026-06-06T20:48:40+00:00

I am trying to retrieve my GCM registration ID from my android emulator but

  • 0

I am trying to retrieve my GCM registration ID from my android emulator but when i debug the program crashes.
This is my MainActivity code:

  try {
       GCMRegistrar.checkDevice(this);       //  <-- Crashes here
       GCMRegistrar.checkManifest(this);
       final String regId = GCMRegistrar.getRegistrationId(this);
       if (regId.equals("")) 
       {
         GCMRegistrar.register(this,Sender_ID);
       }
       else
       {
         Log.v("Registrationnnnnn", "Already registered");
       }
   }
   catch(Exception e)
   {
       Log.e("ErrorHAi",e.getMessage());
   }

I’ve read that this line checks if the device support GCM.But I’ve installed Google Cloud Messaging from SDK Manager extras. I’ve also installed

Android SDK Tools : rev 20
Android SDK Platform Tools : rev 12
Android 4.1 Api 16

When I mention

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" />

this in my manifest file it runs but crashes as I’ve mentioned in the above code.But if I change the targetSdkVersion to xx as mentioned here it says Install_Failed_OLDER_SDK.

I am currently running this application on Android 4.1 API level 16.

Update:

My Logcat:

07-03 20:34:25.878: E/Trace(906): error opening trace file: No such file or directory (2)
07-03 22:30:57.748: E/Trace(1016): error opening trace file: No such file or directory (2)
07-03 22:31:01.998: E/AndroidRuntime(1016): FATAL EXCEPTION: main
07-03 22:31:01.998: E/AndroidRuntime(1016): java.lang.RuntimeException: Unable to instantiate receiver com.pack.gcm.MyBroadcastReceiver: java.lang.ClassNotFoundException: com.pack.gcm.MyBroadcastReceiver
07-03 22:31:01.998: E/AndroidRuntime(1016):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2210)
07-03 22:31:01.998: E/AndroidRuntime(1016):     at android.app.ActivityThread.access$1500(ActivityThread.java:130)
07-03 22:31:01.998: E/AndroidRuntime(1016):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1271)
07-03 22:31:01.998: E/AndroidRuntime(1016):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-03 22:31:01.998: E/AndroidRuntime(1016):     at android.os.Looper.loop(Looper.java:137)
07-03 22:31:01.998: E/AndroidRuntime(1016):     at android.app.ActivityThread.main(ActivityThread.java:4745)
07-03 22:31:01.998: E/AndroidRuntime(1016):     at java.lang.reflect.Method.invokeNative(Native Method)
07-03 22:31:01.998: E/AndroidRuntime(1016):     at java.lang.reflect.Method.invoke(Method.java:511)
07-03 22:31:01.998: E/AndroidRuntime(1016):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
07-03 22:31:01.998: E/AndroidRuntime(1016):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
07-03 22:31:01.998: E/AndroidRuntime(1016):     at dalvik.system.NativeStart.main(Native Method)
07-03 22:31:01.998: E/AndroidRuntime(1016): Caused by: java.lang.ClassNotFoundException: com.pack.gcm.MyBroadcastReceiver
07-03 22:31:01.998: E/AndroidRuntime(1016):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
07-03 22:31:01.998: E/AndroidRuntime(1016):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
07-03 22:31:01.998: E/AndroidRuntime(1016):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
07-03 22:31:01.998: E/AndroidRuntime(1016):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2205)
07-03 22:31:01.998: E/AndroidRuntime(1016):     ... 10 more

Now I don’t know why it is giving such errors although I’ve installed all the prerequisites.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:48:43+00:00Added an answer on June 6, 2026 at 8:48 pm

    Mostly Android G2DM not supporting Android emulator because it is basically depends on that the device has a google account , and the android emulators doesn’t have such an account so when it try to register the device , it doesn’t find the required google account to complete registration take a look at c2dm-only-registered-google-account-receives-messages-from-server

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to retrieve tasks from Rembmer the Milk API. I run this code:
I am trying retrieve user name from the code through graph api, the below
Iam trying to retrieve data from mysql database into stylesheet.php but it is not
I'm trying to retrieve this page using Apache HttpClient: http://quick-dish.tablespoon.com/ Unfortunately, when I try
I am trying to retrieve gcm notification in my android mobile.Everything runs fine,my android
Im trying to retrieve all users from a domain, but I get an error..
I'm trying to retrieve records from the mySQL-database but nothing gets selected. I'm using
Hi I am trying to retrieve values from database. I have a row which
I am trying to retrieve a column from another related table, and display that
I'm trying to retrieve product information from magento by calling its web service using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.