{"record":{"id":"ab2095c09e018280","repo":"microg/GmsCore","slug":"invalid","errorCode":null,"errorMessage":"Invalid ","messagePattern":"Invalid ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"play-services-gcm/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java","lineNumber":239,"sourceCode":"     * <a href=\"http://developer.android.com/google/gcm/index.html\">GCM Developers Guide</a>.</p>\n     *\n     * @param to         string identifying the receiver of the message in the format of\n     *                   <code>SENDER_ID@gcm.googleapis.com</code>. The <code>SENDER_ID</code> should be one of the sender\n     *                   IDs used when calling  {@link com.google.android.gms.iid.InstanceID#getToken(java.lang.String, java.lang.String)}\n     * @param msgId      ID of the message. This is generated by the application. It must be\n     *                   unique for each message. This allows error callbacks and debugging.\n     * @param timeToLive If 0, we'll attempt to send immediately and return an\n     *                   error if we're not connected. Otherwise, the message will be queued.\n     *                   As for server-side messages, we don't return an error if the message has been\n     *                   dropped because of TTL—this can happen on the server side, and it would require\n     *                   extra communication.\n     * @param data       key/value pairs to be sent. Values must be String, any other type will\n     *                   be ignored.\n     * @throws IllegalArgumentException\n     * @throws IOException\n     */\n    public void send(String to, String msgId, long timeToLive, Bundle data) throws IOException {\n        if (TextUtils.isEmpty(to)) throw new IllegalArgumentException(\"Invalid 'to'\");\n\n        if (isLegacyFallback()) {\n            Bundle extras = new Bundle();\n            for (String key : data.keySet()) {\n                Object o = extras.get(key);\n                if (o instanceof String) {\n                    extras.putString(\"gcm.\" + key, (String) o);\n                }\n            }\n            extras.putString(EXTRA_SEND_TO, to);\n            extras.putString(EXTRA_MESSAGE_ID, msgId);\n            InstanceID.getInstance(context).requestToken(\"GCM\", \"upstream\", extras);\n        } else {\n            Bundle extras = data != null ? new Bundle(data) : new Bundle();\n            extras.putString(EXTRA_SEND_TO, to);\n            extras.putString(EXTRA_SEND_FROM, getFrom(to));\n            extras.putString(EXTRA_MESSAGE_ID, msgId);\n            extras.putLong(EXTRA_TTL, timeToLive);","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-gcm/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java#L221-L257","documentation":"Validation in GoogleCloudMessaging.send (the 'Invalid ' message family): a required message attribute such as the message id is null, empty, or malformed, so the message is rejected before transmission.","triggerScenarios":"Thrown at play-services-gcm/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java:239 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply a unique non-empty msgId for every send() call","Validate the receiver and message fields before calling send"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}