microg/GmsCore · error · IllegalArgumentException
Required request information missing
Error message
Required request information missing
What it means
verify() also requires the requesting package name and the auth service (authToken type/service) extras. If either is null it throws IllegalArgumentException, since the consent dialog cannot know what permission is being requested or by which app.
Source
Thrown at play-services-core/src/main/java/org/microg/gms/auth/AskPermissionActivity.java:106
callerUid = intent.getIntExtra(KEY_CALLER_UID, 0);
callerPid = intent.getIntExtra(KEY_CALLER_PID, 0);
fromAccountManager = intent.hasExtra(EXTRA_FROM_ACCOUNT_MANAGER);
if (intent.hasExtra(EXTRA_CONSENT_DATA)) {
try {
consentData = ConsentData.ADAPTER.decode(intent.getByteArrayExtra(EXTRA_CONSENT_DATA));
} catch (Exception e) {
Log.w(TAG, "ConsentData decode failed", e);
}
}
}
if (accountName != null && accountType != null) {
account = new Account(accountName, accountType);
}
}
private void verify(Context context) throws Exception {
if (accountName == null || accountType == null || account == null) throw new IllegalArgumentException("Required account information missing");
if (packageName == null || service == null) throw new IllegalArgumentException("Required request information missing");
if (callerUid == 0) throw new IllegalArgumentException("Required caller information missing");
PackageUtils.getAndCheckPackage(context, packageName, callerUid, callerPid);
PackageManager packageManager = context.getPackageManager();
ApplicationInfo applicationInfo = packageManager.getApplicationInfo(packageName, 0);
appLabel = packageManager.getApplicationLabel(applicationInfo);
appIcon = packageManager.getApplicationIcon(applicationInfo);
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ask_permission);
data = new IntentData(getIntent());
try {
data.verify(this);
} catch (Exception e) {View on GitHub (pinned to 157c9d86ac)
Solutions
- Set both the calling package name and the service (auth token type) extras on the intent before launching.
- Validate the intent in your authenticator code before constructing it.
- Align extra key names with the version of microg/play-services you depend on.
- Log and reject requests missing extras at the authenticator level to give clearer errors.
Example fix
// before Intent i = new Intent(context, AskPermissionActivity.class); i.putExtra(KEY_ACCOUNT_NAME, account.name); // after i.putExtra(KEY_ACCOUNT_NAME, account.name); i.putExtra(KEY_ANDROID_PACKAGE_NAME, callingPackage); i.putExtra(KEY_SERVICE, service);
Defensive patterns
Strategy: validation
Validate before calling
if (packageName == null || service == null) throw new IllegalArgumentException("packageName and service extras are required"); Type guard
if (intent.getStringExtra(KEY_ANDROID_PACKAGE_NAME) == null || intent.getStringExtra(KEY_SERVICE) == null) return false;
Try / catch
try { verify(context); } catch (IllegalArgumentException e) { setResult(RESULT_CANCELED); finish(); } Prevention
- Always include calling package and service extras
- Validate intent completeness in the authenticator before launch
- Keep extra key names in sync with the library version
When it happens
Trigger: Launching AskPermissionActivity with account extras set but missing the packageName and/or service extras in the intent.
Common situations: Partially built auth intents during development; upgrade path where an extra was renamed and the old caller no longer supplies it; hand-rolled AccountAuthenticator responses omitting the service field.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Required account information missing
- deleteAll was set to true but keys were also provided
- Element in keys cannot be null or empty
- retrieveAll was set to true but other constraint(s) was also
- Element in keys cannot be null or empty
AI-assisted analysis of microg/GmsCore@157c9d86ac (2026-09-06).
Data as JSON: /api/errors/3029bd414a92c7ba.
Report an issue: GitHub.