microg/GmsCore · error · UnsupportedOperationException

onInflate not allowed on StreetViewPanoramaViewDelegate

Error message

onInflate not allowed on StreetViewPanoramaViewDelegate

What it means

StreetViewPanoramaViewDelegate.onInflate(Activity, Bundle, Bundle) is intentionally unsupported: XML attribute inflation is handled by StreetViewPanoramaView's constructor or the panorama fragment. Invoking it on the delegate throws UnsupportedOperationException unconditionally.

Source

Thrown at play-services-maps/src/main/java/org/microg/gms/maps/StreetViewPanoramaViewDelegate.java:68

    }

    @Override
    public void onDestroy() {
        try {
            delegate.onDestroy();
        } catch (RemoteException e) {
            throw new RuntimeRemoteException(e);
        }
    }

    @Override
    public void onDestroyView() {
        throw new UnsupportedOperationException("onDestroyView not allowed on StreetViewPanoramaViewDelegate");
    }

    @Override
    public void onInflate(@NonNull Activity activity, @NonNull Bundle options, @Nullable Bundle onInflate) {
        throw new UnsupportedOperationException("onInflate not allowed on StreetViewPanoramaViewDelegate");
    }

    @Override
    public void onLowMemory() {
        try {
            delegate.onLowMemory();
        } catch (RemoteException e) {
            throw new RuntimeRemoteException(e);
        }
    }

    @Override
    public void onPause() {
        try {
            delegate.onPause();
        } catch (RemoteException e) {
            throw new RuntimeRemoteException(e);
        }

View on GitHub (pinned to 157c9d86ac)

Solutions

  1. Do not call onInflate on the delegate; pass StreetViewPanoramaOptions to the StreetViewPanoramaView constructor instead.
  2. Use StreetViewPanoramaFragment/SupportStreetViewPanoramaFragment for XML/fragment embedding.
  3. Remove onInflate forwarding from custom Fragment wrappers.
  4. Build options programmatically (new StreetViewPanoramaOptions().position(...)) rather than via inflation.

Example fix

// before
@Override
public void onInflate(Activity a, Bundle opts, Bundle s) {
    delegate.onInflate(a, opts, s); // always throws
}
// after
@Override
public void onInflate(Activity a, Bundle opts, Bundle s) {
    panoramaOptions = new StreetViewPanoramaOptions(); // build from your own attribute parsing
}
Defensive patterns

Strategy: type-guard

Type guard

public static boolean supportsInflate(LifecycleDelegate d) {
    return !(d instanceof StreetViewPanoramaViewDelegate);
}

Try / catch

try {
    delegate.onInflate(activity, options, savedInstanceState);
} catch (UnsupportedOperationException e) {
    // build StreetViewPanoramaOptions yourself or use the fragment
}

Prevention

When it happens

Trigger: Calling delegate.onInflate(activity, options, savedInstanceState), or a Fragment.onInflate forwarding attributes to the delegate, or XML inflation combined with manual delegate lifecycle driving.

Common situations: XML-declared Street View views with custom Fragment plumbing, code ported from other GMS delegate implementations, or migration from Google Maps SDK internals.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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