microg/GmsCore · error · NullPointerException

transitions can't be null

Error message

transitions can't be null

What it means

The ActivityTransitionRequest(List<ActivityTransition>) constructor validates its input: a null transitions list fails the Preconditions check and raises NullPointerException with this message before the request object is built.

Source

Thrown at play-services-location/src/main/java/com/google/android/gms/location/ActivityTransitionRequest.java:61

            int res = Integer.compare(o1.getActivityType(), o2.getActivityType());
            if (res != 0) return res;
            res = Integer.compare(o1.getTransitionType(), o2.getTransitionType());
            return res;
        }
    };

    private ActivityTransitionRequest() {
    }

    /**
     * Creates an {@link ActivityTransitionRequest} object by specifying a list of interested activity transitions.
     *
     * @param transitions a list of interested activity transitions
     * @throws NullPointerException     if {@code transitions} is {@code null}
     * @throws IllegalArgumentException if {@code transitions} is an empty list or if there are duplicated transitions in this list
     */
    public ActivityTransitionRequest(List<ActivityTransition> transitions) {
        if (transitions == null) throw new NullPointerException("transitions can't be null");
        if (transitions.isEmpty()) throw new IllegalArgumentException("transitions can't be empty.");
        Set<ActivityTransition> set = new TreeSet<ActivityTransition>(IS_SAME_TRANSITION);
        set.addAll(transitions);
        if (transitions.size() != set.size()) throw new IllegalArgumentException("Found duplicated transition");
        this.activityTransitions = Collections.unmodifiableList(transitions);
    }

    /**
     * Serializes this request to the given intent.
     *
     * @param intent the intent to serailize this object to
     */
    public void serializeToIntentExtra(Intent intent) {
        intent.putExtra(EXTRA, SafeParcelableSerializer.serializeToBytes(this));
    }

    @Override
    public boolean equals(Object o) {

View on GitHub (pinned to 157c9d86ac)

Solutions

  1. Pass a non-null list of ActivityTransition objects
  2. Default to an empty list when source data is absent (then satisfy the non-empty check)
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at play-services-location/src/main/java/com/google/android/gms/location/ActivityTransitionRequest.java:61 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/1686504ee2fe364f. Report an issue: GitHub.