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 9006059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:18:46+00:00 2026-06-16T01:18:46+00:00

I am Trying to register the Device in the cloud (Google Cloud Messaging GCM

  • 0

I am Trying to register the Device in the cloud (Google Cloud Messaging GCM)

but some Error facing the application

can you help me on this

Here’s My Manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.test09_gsm"
    android:versionCode="1"
    android:versionName="1.0" >

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


    <permission android:name="com.example.test09_gsm.permission.C2D_MESSAGE" android:protectionLevel="signature" />

    <uses-permission android:name="com.example.test09_gsme.permission.C2D_MESSAGE" /> 

    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />


    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.test09_gsm.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
             <intent-filter>
                 <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                 <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                 <category android:name="com.example.test09_gsm" />
             </intent-filter>
        </receiver>

        <service android:name=".GCMIntentService" />
    </application>


</manifest>

Hers’s The Class

package com.example.test09_gsm;

import com.google.android.gcm.GCMBaseIntentService;
import android.content.Context;
import android.content.Intent;
import android.util.Log;


public class GCMIntentService extends GCMBaseIntentService {
    public static String TAG = "GCMIntentService";

    public GCMIntentService(String senderId)
    {
        super(senderId);
        Log.d("GCMIntentService", senderId);
    }

    @Override
    protected void onError(Context arg0, String arg1) {
        Log.d("onError", arg1);
    }

    @Override
    protected boolean onRecoverableError(Context context, String errorId){
        Log.d("onRecoverableError", errorId);
        return false;
    }

    @Override
    protected void onMessage(Context arg0, Intent arg1) {
        Log.d("onMessage", String.valueOf(arg1));
    }

    @Override
    protected void onRegistered(Context arg0, String arg1) {
        Log.d("onRegistered", arg1);
    }

    @Override
    protected void onUnregistered(Context arg0, String arg1) {
        Log.d("onUnregistered", arg1);
    }
}

Main Activity

package com.example.test09_gsm;

import com.google.android.gcm.GCMRegistrar;

import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        GCMRegistrar.checkDevice(this);
        GCMRegistrar.checkManifest(this);
        final String regId = GCMRegistrar.getRegistrationId(this);
        if (regId.equals(""))
        {
          GCMRegistrar.register(this, "XXXXXXXXXXXX");
        }
        else
        {
          Log.v("Info : ", "Already registered");
        }

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu)
    {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

}

LogCat

12-15 00:28:28.935: E/Trace(4569): error opening trace file: No such file or directory (2)
12-15 00:28:29.085: D/GCMRegistrar(4569): resetting backoff for com.example.test09_gsm
12-15 00:28:29.085: V/GCMRegistrar(4569): Registering app com.example.test09_gsm of senders XXXXXXXXXXXX
12-15 00:28:29.160: D/libEGL(4569): loaded /system/lib/egl/libEGL_mali.so
12-15 00:28:29.165: D/libEGL(4569): loaded /system/lib/egl/libGLESv1_CM_mali.so
12-15 00:28:29.165: D/libEGL(4569): loaded /system/lib/egl/libGLESv2_mali.so
12-15 00:28:29.170: D/(4569): Device driver API match
12-15 00:28:29.170: D/(4569): Device driver API version: 10
12-15 00:28:29.170: D/(4569): User space API version: 10 
12-15 00:28:29.170: D/(4569): mali: REVISION=Linux-r2p4-02rel0 BUILD_DATE=Wed Sep 12 17:53:53 KST 2012 
12-15 00:28:29.205: D/OpenGLRenderer(4569): Enabling debug mode 0
12-15 00:28:29.985: V/GCMBroadcastReceiver(4569): onReceive: com.google.android.c2dm.intent.REGISTRATION
12-15 00:28:29.985: V/GCMBroadcastReceiver(4569): GCM IntentService class: com.example.test09_gsm.GCMIntentService
12-15 00:28:29.985: V/GCMBaseIntentService(4569): Acquiring wakelock
12-15 00:28:30.000: D/dalvikvm(4569): newInstance failed: no <init>()
12-15 00:28:30.000: D/AndroidRuntime(4569): Shutting down VM
12-15 00:28:30.000: W/dalvikvm(4569): threadid=1: thread exiting with uncaught exception (group=0x40e372a0)
12-15 00:28:30.000: E/AndroidRuntime(4569): FATAL EXCEPTION: main
12-15 00:28:30.000: E/AndroidRuntime(4569): java.lang.RuntimeException: Unable to instantiate service com.example.test09_gsm.GCMIntentService: java.lang.InstantiationException: can't instantiate class com.example.test09_gsm.GCMIntentService; no empty constructor
12-15 00:28:30.000: E/AndroidRuntime(4569):     at android.app.ActivityThread.handleCreateService(ActivityThread.java:2388)
12-15 00:28:30.000: E/AndroidRuntime(4569):     at android.app.ActivityThread.access$1600(ActivityThread.java:140)
12-15 00:28:30.000: E/AndroidRuntime(4569):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1309)
12-15 00:28:30.000: E/AndroidRuntime(4569):     at android.os.Handler.dispatchMessage(Handler.java:99)
12-15 00:28:30.000: E/AndroidRuntime(4569):     at android.os.Looper.loop(Looper.java:137)
12-15 00:28:30.000: E/AndroidRuntime(4569):     at android.app.ActivityThread.main(ActivityThread.java:4898)
12-15 00:28:30.000: E/AndroidRuntime(4569):     at java.lang.reflect.Method.invokeNative(Native Method)
12-15 00:28:30.000: E/AndroidRuntime(4569):     at java.lang.reflect.Method.invoke(Method.java:511)
12-15 00:28:30.000: E/AndroidRuntime(4569):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
12-15 00:28:30.000: E/AndroidRuntime(4569):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
12-15 00:28:30.000: E/AndroidRuntime(4569):     at dalvik.system.NativeStart.main(Native Method)
12-15 00:28:30.000: E/AndroidRuntime(4569): Caused by: java.lang.InstantiationException: can't instantiate class com.example.test09_gsm.GCMIntentService; no empty constructor
12-15 00:28:30.000: E/AndroidRuntime(4569):     at java.lang.Class.newInstanceImpl(Native Method)
12-15 00:28:30.000: E/AndroidRuntime(4569):     at java.lang.Class.newInstance(Class.java:1319)
12-15 00:28:30.000: E/AndroidRuntime(4569):     at android.app.ActivityThread.handleCreateService(ActivityThread.java:2385)
12-15 00:28:30.000: E/AndroidRuntime(4569):     ... 10 more

now how can i resolve this problem and receive the registration ID And Use it

thanks in advance

  • 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-16T01:18:47+00:00Added an answer on June 16, 2026 at 1:18 am

    try after adding default constructor to GCMIntentService as :

    public GCMIntentService() {
            super("IntentService");
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting this error [C2DMRegistrar.39] AuthTokenCallback: authFailed when trying to register a device to
I have been trying to get Google Cloud Messaging to create push notifications. I
I'm trying to register an Android app with google GCM and it seems to
I'm trying to set up an application to work with gcm but every time
I am trying to register a device onto GCM using the following code: public
I am trying to register a WebDeleting event receiver within SharePoint. This works fine
Trying to write out syslog entries containing strings but they don't register. // person.name
As the title says, keep getting this error when trying to compile. From Googling
I am trying to register with BlackBerry push notifications, but it shows a time
I'm trying register presenters with Windsor using the convention based method but trying to

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.