microg/GmsCore · error · UnsupportedOperationException
onDestroyView not allowed on StreetViewPanoramaViewDelegate
Error message
onDestroyView not allowed on StreetViewPanoramaViewDelegate
What it means
StreetViewPanoramaViewDelegate.onDestroyView() is intentionally unsupported and throws UnsupportedOperationException unconditionally; view teardown belongs to StreetViewPanoramaView.onDestroy(), not the delegate.
Source
Thrown at play-services-maps/src/main/java/org/microg/gms/maps/StreetViewPanoramaViewDelegate.java:63
container.removeAllViews();
container.addView(view);
} catch (RemoteException e) {
throw new RuntimeRemoteException(e);
}
}
@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() {View on GitHub (pinned to 157c9d86ac)
Solutions
- Call streetViewPanoramaView.onDestroy() from your Fragment/view teardown instead of the delegate.
- Remove onDestroyView forwarding code that targets the delegate.
- Let StreetViewPanoramaFragment manage teardown if you use fragments.
- Only invoke delegate methods that are actually implemented (onCreate, onResume, onPause, onDestroy, onLowMemory, etc.).
Example fix
// before
@Override
public void onDestroyView() {
delegate.onDestroyView(); // always throws
}
// after
@Override
public void onDestroyView() {
streetViewPanoramaView.onDestroy();
} Defensive patterns
Strategy: type-guard
Type guard
public static boolean supportsDestroyView(LifecycleDelegate d) {
return !(d instanceof StreetViewPanoramaViewDelegate);
} Try / catch
try {
delegate.onDestroyView();
} catch (UnsupportedOperationException e) {
streetViewPanoramaView.onDestroy(); // correct teardown path
} Prevention
- Tear down via StreetViewPanoramaView.onDestroy(), not the delegate.
- Keep Fragment.onDestroyView forwarding limited to public view APIs.
- Prefer panorama fragments so teardown is lifecycle-managed.
- Enumerate only supported delegate methods when writing lifecycle glue.
When it happens
Trigger: Calling delegate.onDestroyView() directly, or a Fragment.onDestroyView() that forwards to the delegate instead of streetViewPanoramaView.onDestroy().
Common situations: Custom Fragment wrappers around Street View, copy-pasted lifecycle forwarding code, or generic lifecycle dispatchers enumerating all delegate methods.
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
- onCreateView 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/7a0dc9658b4a6896.
Report an issue: GitHub.