microg/GmsCore · error · IllegalArgumentException

No sender ids

Error message

No sender ids

What it means

Thrown by GoogleCloudMessaging.register when the varargs senderIds list is empty. The registration flow requires at least one sender (a project number authorized to send messages to the app); calling register() with zero sender ids leaves no authorization principal to register against, so the method rejects the request with this IllegalArgumentException before contacting the GCM service.

Source

Thrown at play-services-gcm/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java:196

     * <p/>
     * If you want to modify the list of senders, you must call <code>unregister()</code> first.
     * <p/>
     * Most applications use a single sender ID. You may use multiple senders if different
     * servers may send messages to the app or for testing.</p>
     *
     * @param senderIds list of project numbers or Google accounts identifying who is allowed to
     *                  send messages to this application.
     * @return registration id
     * @throws IOException
     * @deprecated Instead, for GCM registration, use
     * {@link com.google.android.gms.iid.InstanceID#getToken(java.lang.String, java.lang.String)}.
     * Set authorizedEntity to a sender ID and scope to {@link com.google.android.gms.gcm.GoogleCloudMessaging#INSTANCE_ID_SCOPE}.
     */
    @Deprecated
    public String register(String... senderIds) throws IOException {
        if (Looper.getMainLooper() == Looper.myLooper()) throw new IOException(ERROR_MAIN_THREAD);

        if (senderIds == null || senderIds.length == 0) throw new IllegalArgumentException("No sender ids");
        StringBuilder sb = new StringBuilder(senderIds[0]);
        for (int i = 1; i < senderIds.length; i++) {
            sb.append(',').append(senderIds[i]);
        }
        String sender = sb.toString();

        if (isLegacyFallback()) {
            Bundle extras = new Bundle();
            extras.putString(EXTRA_SENDER_LEGACY, sender);
            return InstanceID.getInstance(context).getToken(sb.toString(), INSTANCE_ID_SCOPE, extras);
        } else {
            Bundle extras = new Bundle();
            extras.putString(EXTRA_SENDER, sender);
            return rpc.handleRegisterMessageResult(rpc.sendRegisterMessageBlocking(extras));
        }
    }

    /**

View on GitHub (pinned to 157c9d86ac)

Solutions

  1. Pass at least one project number / sender ID to register()
  2. Check the sender list for emptiness before invoking registration
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at play-services-gcm/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java:196 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of microg/GmsCore@157c9d86ac (2026-09-06). Data as JSON: /api/errors/fc4080eee690b6e4. Report an issue: GitHub.