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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:23:12+00:00 2026-06-09T07:23:12+00:00

How to get the registrationId ? I always get the ACCOUNT_MISSING error MainActivity package

  • 0

How to get the registrationId ?

I always get the ACCOUNT_MISSING error

MainActivity

package com.example.gcm;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;
import com.google.android.gcm.GCMRegistrar;

public class MainActivity extends Activity {

    private static final String SENDER_ID = "45552950387";

    @Override
    public 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, SENDER_ID);
          Log.d("show", "Already registered1"+regId);
        } else {
          Log.d("show", "Already registered");
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }


}

GCMIntentService

package com.example.gcm;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.google.android.gcm.GCMBaseIntentService;

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

    public GCMIntentService() {
        super("45552950387");
    }

    @Override
    protected void onRegistered(Context context, String registrationId) {
        Log.i(TAG, "Device registered: regId = " + registrationId);
    }

    @Override
    protected void onUnregistered(Context context, String registrationId) {
        Log.i(TAG, "Device unregistered");
    }

    @Override
    protected void onMessage(Context context, Intent intent) {
        Log.i(TAG, "Received message");
        String a = intent.getStringExtra("A");
        generateNotification(context, a);
    }

    @Override
    protected void onDeletedMessages(Context context, int total) {
        Log.i(TAG, "Received deleted messages notification");

    }

    @Override
    public void onError(Context context, String errorId) {
        Log.i(TAG, "Received error: " + errorId);

    }

    @Override
    protected boolean onRecoverableError(Context context, String errorId) {
        Log.i(TAG, "Received recoverable error: " + errorId);
        return super.onRecoverableError(context, errorId);
    }

    private void generateNotification(Context context, String message) {

        NotificationManager notificationManager = (NotificationManager) context
                .getSystemService(NOTIFICATION_SERVICE);

        Notification notification = new Notification();
        notification.icon = R.drawable.ic_launcher;
        notification.tickerText = "notification on status bar.";
        notification.defaults = Notification.DEFAULT_ALL;
        notification.setLatestEventInfo(context, "Title", message, null);
        notificationManager.notify(0, notification);
    }
}

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.gcm"
android:versionCode="1"
android:versionName="1.0" >

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

<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" />

<permission android:name="com.example.gcm.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.example.gcm.permission.C2D_MESSAGE" /> 

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
        <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.gcm" />
      </intent-filter>
    </receiver>
 <service android:name="com.example.gcm.GCMIntentService" />
</application>

This is my LogCat

08-08 13:54:19.844: D/dalvikvm(618): GC_EXPLICIT freed 45K, 49% free 2751K/5379K, external 1625K/2137K, paused 58ms
08-08 13:54:22.944: D/GCMRegistrar(618): resetting backoff for com.example.gcm
08-08 13:54:22.944: V/GCMRegistrar(618): Registering app com.example.gcm of senders 45552950387
08-08 13:54:22.994: D/show(618): Already registered1
08-08 13:54:23.224: V/GCMBroadcastReceiver(618): onReceive: com.google.android.c2dm.intent.REGISTRATION
08-08 13:54:23.224: V/GCMBroadcastReceiver(618): GCM IntentService class: com.example.gcm.GCMIntentService
08-08 13:54:23.224: V/GCMBaseIntentService(618): Acquiring wakelock
08-08 13:54:23.464: V/GCMBaseIntentService(618): Intent service name: GCMIntentService-45552950387-3
08-08 13:54:23.504: D/GCMBaseIntentService(618): handleRegistration: registrationId = null, error = ACCOUNT_MISSING, unregistered = null
08-08 13:54:23.504: D/GCMBaseIntentService(618): Registration error: ACCOUNT_MISSING
08-08 13:54:23.524: I/GCMIntentService(618): Received error: ACCOUNT_MISSING
08-08 13:54:23.524: V/GCMBaseIntentService(618): Releasing wakelock

I am sure the sender ID is correct and also import gcm.jar in the project classpath

  • 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-09T07:23:13+00:00Added an answer on June 9, 2026 at 7:23 am

    ACCOUNT_MISSING error occurred when there is no Google account on the phone.

    There is no Google account on the phone. The Android application
    should ask the user to open the account manager and add a Google
    account. Fix on the device side.

    Check here for more information.

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

Sidebar

Related Questions

I'm trying to get the Registration-Free Activation of COM Components: A Walkthrough sample from
I've scoured the internet for a while now and I cannot get my Android
On Android applications, how to get Registration Id?
I am trying to get C2DM to work, I'm following the ChrometoPhone example here
I have built and Android app (not in the Market yet) and I am
I'm overhauling certain parts of my app to use the new GCM service to
I'm generating XML using XDocument in C#. Everything works fine except I always get
Attempting/struggling to get registration and sign-up working within an active admin project. I have
At the end of my registration process you get to a payment screen where
Get class from div inside an li and add to the same li. The

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.