Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnsupportedOperationException after updating to 9.0.0 #2823

Open
Nohus opened this issue Jan 25, 2025 · 3 comments
Open

UnsupportedOperationException after updating to 9.0.0 #2823

Nohus opened this issue Jan 25, 2025 · 3 comments

Comments

@Nohus
Copy link
Contributor

Nohus commented Jan 25, 2025

Updating the library from version 8.4.5 to 9.0.0 results in the following crash on startup:

java.lang.UnsupportedOperationException: Failed to resolve attribute at index 7: TypedValue{t=0x2/d=0x7f040146 a=7}, theme={InheritanceMap=[id=0x7f15000bmy.app.debug:style/AppTheme, id=0x7f1502a6my.app.debug:style/Theme.MaterialComponents.DayNight.NoActionBar, id=0x7f1502bfmy.app.debug:style/Theme.MaterialComponents.Light.NoActionBar, id=0x7f1502b1my.app.debug:style/Theme.MaterialComponents.Light, id=0x7f15006fmy.app.debug:style/Base.Theme.MaterialComponents.Light, id=0x7f1500a8my.app.debug:style/Base.V21.Theme.MaterialComponents.Light, id=0x7f150096my.app.debug:style/Base.V14.Theme.MaterialComponents.Light, id=0x7f150097my.app.debug:style/Base.V14.Theme.MaterialComponents.Light.Bridge, id=0x7f150162my.app.debug:style/Platform.MaterialComponents.Light, id=0x7f150268my.app.debug:style/Theme.AppCompat.Light, id=0x7f150053my.app.debug:style/Base.Theme.AppCompat.Light, id=0x7f1500bamy.app.debug:style/Base.V28.Theme.AppCompat.Light, id=0x7f1500b7my.app.debug:style/Base.V26.Theme.AppCompat.Light, id=0x7f1500b1my.app.debug:style/Base.V23.Theme.AppCompat.Light, id=0x7f1500afmy.app.debug:style/Base.V22.Theme.AppCompat.Light, id=0x7f1500a4my.app.debug:style/Base.V21.Theme.AppCompat.Light, id=0x7f1500bdmy.app.debug:style/Base.V7.Theme.AppCompat.Light, id=0x7f15015fmy.app.debug:style/Platform.AppCompat.Light, id=0x7f15016amy.app.debug:style/Platform.V25.AppCompat.Light, id=0x1030241android:style/Theme.Material.Light.NoActionBar, id=0x1030237android:style/Theme.Material.Light, id=0x103000candroid:style/Theme.Light, id=0x1030005android:style/Theme], Themes=[my.app.debug:style/AppTheme, forced, my.app.debug:style/Theme.AppCompat.Empty, forced, android:style/Theme.DeviceDefault.Light.DarkActionBar, forced]}
at android.content.res.TypedArray.getColor(TypedArray.java:529)
at com.mikepenz.materialdrawer.util.UtilsKt$getSelectedColor$color$1.invoke(Utils.kt:59)
at com.mikepenz.materialdrawer.util.UtilsKt$getSelectedColor$color$1.invoke(Utils.kt:58)
at com.mikepenz.materialdrawer.util.UtilsKt.resolveStyledValue(Utils.kt:90)
at com.mikepenz.materialdrawer.util.UtilsKt.resolveStyledValue$default(Utils.kt:83)

Happy to provide more info as needed. I assume I'm missing some breaking change, but I haven't seen any migration steps in the release notes.

@connyduck
Copy link
Contributor

This sounds like you don't use a Material3 theme for your Activity https://github.com/mikepenz/MaterialDrawer?tab=readme-ov-file#note

@Nohus
Copy link
Contributor Author

Nohus commented Jan 26, 2025

Thanks, that indeed fixes it, would be useful to have it in https://github.com/mikepenz/MaterialDrawer/blob/develop/MIGRATION.md

However, switching to the Material3 theme completely redesigns the look of my app, so it's not a valid solution. Are apps not using Material3 no longer supported?

@mikepenz
Copy link
Owner

The readme notes that v9 requires material 3:

Using v9.x with Material 3 theming requires a Material3 theme as base for the activity.

There are no more updates planned for legacy material. For that you'd have to stay on 8.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants