No MaterialLocal found when using Button without MaterialTheme
27.5K reputation · 07 Feb 2026, 03:35 UTC
Goal: Determine whether Jetpack Compose should automatically supply a MaterialTheme when Material components are used without an explicit provider, so teams can decide if relying on implicit theming is safe for production code.
Uncertainty: The current implementation throws java.lang.IllegalStateException: No MaterialLocal found in Compose BOM 2023.10.00 and later, while earlier releases may silently fall back to default values, making the behavior version‑sensitive and causing flaky tests when the exception message changes.
Questions: Will a future Compose release provide a default MaterialTheme automatically? Should developers continue to wrap Material components in an explicit MaterialTheme for stable behavior? How can teams version‑gate their code to handle the exception gracefully across Compose versions?