XF-Material-Library icon indicating copy to clipboard operation
XF-Material-Library copied to clipboard

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

Open luismts opened this issue 3 years ago • 11 comments

🐛 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:

  • [ ] :iphone: iOS
  • [x] :robot: Android
  • [ ] :checkered_flag: WPF
  • [ ] :earth_americas: UWP
  • [ ] :apple: MacOS
  • [ ] :tv: tvOS
  • [x] :monkey: Xamarin.Forms

luismts avatar Apr 17 '21 04:04 luismts

Any news about this?

cc @martijn00

luismts avatar May 03 '21 18:05 luismts

Also having this issue https://github.com/Baseflow/XF-Material-Library/issues/206

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

The line with the issue is this one https://github.com/Baseflow/XF-Material-Library/blob/e1779f84e95cffe1a6a00bdd129cc2c8b25c63c5/XF.Material/UI/Dialogs/MaterialConfirmationDialog.xaml#L19

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 avatar May 03 '21 18:05 luismts

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 avatar May 26 '21 15:05 luismts

@kerberosargos can you help me with this?

luismts avatar May 27 '21 03:05 luismts

@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

kerberosargos avatar May 29 '21 23:05 kerberosargos

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 avatar May 31 '21 14:05 luismts

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.

luismts avatar Jun 01 '21 18:06 luismts

You should remove installed plugin after that you should install this one. Set your nuget settings as local for installing.

Luis Matos @.***>, 1 Haz 2021 Sal, 21:53 tarihinde şunu yazdı:

It didn't work for me @kerberosargos https://github.com/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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Baseflow/XF-Material-Library/issues/425#issuecomment-852365815, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACWWPUABYG6E5HACRYWYC23TQUUELANCNFSM43CVP2XQ .

kerberosargos avatar Jun 01 '21 19:06 kerberosargos

Ok, lets me try.

luismts avatar Jun 01 '21 19:06 luismts

Didn't work @kerberosargos

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

image

luismts avatar Jun 01 '21 19:06 luismts

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 ?

lunjio avatar Feb 06 '22 16:02 lunjio