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

[Bug] System.InvalidOperationException: 'Invalid on Color.Default' #425

Open
2 of 7 tasks
luismts opened this issue Apr 17, 2021 · 11 comments
Open
2 of 7 tasks

[Bug] System.InvalidOperationException: 'Invalid on Color.Default' #425

luismts opened this issue Apr 17, 2021 · 11 comments

Comments

@luismts
Copy link

luismts commented Apr 17, 2021

🐛 Bug Report

I'm using a MaterialButton. The app is crazing in the init with the following code:

...
_materialButton.TextColor.MultiplyAlpha(0.38).ToAndroid()
...

Link file here. More info here.

Reproduction steps

I just add a material button and the app cant compile.

Configuration

Version: 1.7.8

Platform:

  • 📱 iOS
  • 🤖 Android
  • 🏁 WPF
  • 🌎 UWP
  • 🍎 MacOS
  • 📺 tvOS
  • 🐒 Xamarin.Forms
@luismts
Copy link
Author

luismts commented May 3, 2021

Any news about this?

cc @martijn00

@luismts
Copy link
Author

luismts commented May 3, 2021

Also having this issue #206

I'm missing default resources and I don't know why.

The line with the issue is this one

WidthRequest="{StaticResource Material.Dialog.Width}">

I'm using this configuration in a modular app with prism.

XF.Material.Forms.Material.Init(this);
InitializeComponent();
XF.Material.Forms.Material.Use("Material.Configuration");

I have the configuration in a separate project.

@luismts
Copy link
Author

luismts commented May 26, 2021

I was having a problem with Material.Dialog.Width. It seems default resources arent being merged. I add it manually and after that, I have the same error.

**System.InvalidOperationException:** 'Invalid on Color.Default'

Can you help me with that?
cc @martijn00

@luismts
Copy link
Author

luismts commented May 27, 2021

@kerberosargos can you help me with this?

@kerberosargos
Copy link

@kerberosargos can you help me with this?

I am sorry I have seen your post late. Can you try this package?
XF.Material.1.7.7.1.zip

@luismts
Copy link
Author

luismts commented May 31, 2021

Sure

@kerberosargos can you help me with this?

I am sorry I have seen your post late. Can you try this package?
XF.Material.1.7.7.1.zip

@luismts
Copy link
Author

luismts commented Jun 1, 2021

It didn't work for me @kerberosargos . Also I don't know if I did correctly. That package is for the .netstandard project?

My workaround was:

XF.Material.Forms.Material.Init(this);
InitializeComponent();
XF.Material.Forms.Material.Init(this); // WORKAROUND: Solving some reference issues

Without that line, controls break the app. The controls are showing but we cant interact with them because are breaking the app.

As I said I have a separated project with all the resources the app use including styles, colors, etc.

@kerberosargos
Copy link

kerberosargos commented Jun 1, 2021 via email

@luismts
Copy link
Author

luismts commented Jun 1, 2021

Ok, lets me try.

@luismts
Copy link
Author

luismts commented Jun 1, 2021

Didn't work @kerberosargos

Control: MaterialTextField with Choices
Behavior: When I tap the control the app break

image

@lunjio
Copy link
Contributor

lunjio commented Feb 6, 2022

You told that you have a configuration in separate project, but have you added that ResourceDictonary in you main App's ResourceDictonary to MergedDictonaries section ?

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