Cant resolve Widget.MaterialComponents.TextInputLayout.*.ExposedDropdownMenu
And don't forget to use Theme.MaterialComponents in your application
AndroidManifest.xml
<application
android:theme="@style/AppTheme"
...
style.xml
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
According to this issue, the *
in the documentation means to using any style from TextInputLayout
, such as FilledBox
or OutlinedBox
.
Moreover, it is not yet available in the 1.1.0 version, so I successfully made it work using this dependency:
implementation 'com.google.android.material:material:1.2.0-alpha06'
and any of these two styles (remember to use Theme.MaterialComponents in your application, as @R3mx mentioned):
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
I raised this query in Android Material Components' Github issues.
Based on this response, the public documentation is based not on the current stable release, but on the latest alpha (or beta) release. There is no way to tell from the documentation on material.io about which components are in stable, alpha or beta versions of the library.
Having clarified that, the solution to this issue is to upgrade your support-design library, as suggested by @jeel-vankhede, to:
implementation 'com.google.android.material:material:1.1.0-alpha07'
Related heads up, in case you are also using ViewModels (lib v. 2.0.0):
Upgrading to 1.1.0-alpha of Material design library automatically updates the androidx.lifecycle libraries to 2.1.0+. This update has a breaking change from 2.0.0 which may break your view model code. This change is only observed in minified versions of the app.