microg/GmsCore · error · UnsupportedOperationException
onCreateView not allowed on StreetViewPanoramaViewDelegate
Error message
onCreateView not allowed on StreetViewPanoramaViewDelegate
What it means
StreetViewPanoramaViewDelegate.onCreateView(LayoutInflater, ViewGroup, Bundle) is deliberately unsupported: StreetViewPanoramaView owns its view creation through its container, so inflation via the delegate is treated as misuse and throws UnsupportedOperationException unconditionally.
Source
Thrown at play-services-maps/src/main/java/org/microg/gms/maps/StreetViewPanoramaViewDelegate.java:34
import com.google.android.gms.dynamic.ObjectWrapper;
import com.google.android.gms.maps.OnStreetViewPanoramaReadyCallback;
import com.google.android.gms.maps.StreetViewPanorama;
import com.google.android.gms.maps.internal.*;
import com.google.android.gms.maps.model.RuntimeRemoteException;
public class StreetViewPanoramaViewDelegate implements StreetViewLifecycleDelegate {
private final ViewGroup container;
private final IStreetViewPanoramaViewDelegate delegate;
private View view;
public StreetViewPanoramaViewDelegate(ViewGroup container, IStreetViewPanoramaViewDelegate delegate) {
this.container = container;
this.delegate = delegate;
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup parent, @Nullable Bundle savedInstanceState) {
throw new UnsupportedOperationException("onCreateView not allowed on StreetViewPanoramaViewDelegate");
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
try {
Bundle temp = new Bundle();
MapsBundleHelper.transfer(savedInstanceState, temp);
delegate.onCreate(temp);
MapsBundleHelper.transfer(temp, savedInstanceState);
view = (View) ObjectWrapper.unwrap(delegate.getView());
container.removeAllViews();
container.addView(view);
} catch (RemoteException e) {
throw new RuntimeRemoteException(e);
}
}
@OverrideView on GitHub (pinned to 157c9d86ac)
Solutions
- Create the panorama via StreetViewPanoramaView (constructed with StreetViewPanoramaOptions) and forward only its supported lifecycle callbacks.
- In a Fragment, instantiate StreetViewPanoramaView in onCreateView yourself and return it.
- Remove any onCreateView forwarding to the delegate.
- Prefer StreetViewPanoramaFragment/SupportStreetViewPanoramaFragment when fragment embedding is acceptable.
Example fix
// before
@Override
public View onCreateView(LayoutInflater inf, ViewGroup p, Bundle s) {
return delegate.onCreateView(inf, p, s); // always throws
}
// after
@Override
public View onCreateView(LayoutInflater inf, ViewGroup p, Bundle s) {
streetViewPanoramaView = new StreetViewPanoramaView(getContext(), options);
streetViewPanoramaView.onCreate(s);
return streetViewPanoramaView;
} Defensive patterns
Strategy: type-guard
Type guard
public static boolean supportsViewCreation(LifecycleDelegate d) {
return !(d instanceof StreetViewPanoramaViewDelegate);
} Try / catch
try {
view = delegate.onCreateView(inflater, parent, savedInstanceState);
} catch (UnsupportedOperationException e) {
view = streetViewPanoramaView; // use the owning view instead
} Prevention
- Create panorama views via StreetViewPanoramaView or StreetViewPanoramaFragment, never via the delegate.
- Construct StreetViewPanoramaView yourself in Fragment.onCreateView.
- Do not reflectively call all delegate lifecycle methods.
- Review Street View embedding code during microG migrations for delegate misuse.
When it happens
Trigger: Calling streetViewPanoramaViewDelegate.onCreateView(...) directly, or a Fragment's onCreateView forwarding to the delegate instead of using StreetViewPanoramaView.
Common situations: Embedding Street View in custom Fragments with hand-written lifecycle plumbing, porting Google Maps SDK internal delegate usage to microG, or frameworks that invoke every delegate lifecycle method blindly.
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
- onDestroyView not allowed on StreetViewPanoramaViewDelegate
- onInflate not allowed on StreetViewPanoramaViewDelegate
- onCreateView not allowed on MapViewDelegate
- onDestroyView not allowed on MapViewDelegate
- onInflate not allowed on MapViewDelegate
AI-assisted analysis of microg/GmsCore@157c9d86ac (2026-09-06).
Data as JSON: /api/errors/78e2071a4483a3d6.
Report an issue: GitHub.