maui icon indicating copy to clipboard operation
maui copied to clipboard

Resizetizer is not working if you get a .DS_Store file inside you Fonts files folder

Open JoacimWall opened this issue 2 years ago • 10 comments
trafficstars

Description

Build fail and you get error. /usr/local/share/dotnet/packs/Microsoft.Maui.Resizetizer.Sdk/7.0.59/targets/Microsoft.Maui.Resizetizer.targets(9,9): Error: One or more invalid file names were detected. File names must be lowercase, start and end with a letter character, and contain only alphanumeric characters or underscores: (LiberoClub)

Steps to Reproduce

[Sorry but I don't have the time now to create a repo. I think you should only add files that is font files from the Fonts folder. Or add the path to the file that is not correct in the build log. ]

https://github.com/JoacimWall/Joacim_Bug_Report/tree/main/Resizetizer_DSStoreFile/DSStoreBug Add a .DS_File file to the Fonts folder try build and you get the error

Link to public reproduction project repository

Sorry but I don't have the time now to create a repo

Version with bug

6.0.312

Last version that worked well

6.0.312

Affected platforms

iOS, macOS

Affected platform versions

IOS 16.2

Did you find any workaround?

Delete the .Ds_Store file. A bit hard to find why I got this error when there says that are som naming error.

Relevant log output

No response

JoacimWall avatar Feb 20 '23 09:02 JoacimWall

Hi @JoacimWall. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost avatar Feb 23 '23 19:02 ghost

@mattleibow @Redth if you have any additional thoughts?

PureWeen avatar Feb 23 '23 19:02 PureWeen

This is also the case (albeit with a more obscure error message) if you have a vector file (.svg) that is somehow borked.

UkeHa avatar Feb 24 '23 08:02 UkeHa

Hi @JoacimWall. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

https://github.com/JoacimWall/Joacim_Bug_Report/tree/main/Resizetizer_DSStoreFile/DSStoreBug

JoacimWall avatar Feb 27 '23 09:02 JoacimWall

Hi @JoacimWall. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost avatar Feb 28 '23 18:02 ghost

I think this is behaviour that is mostly correct, but could be improved:

If the file is invalid, then the build should fail. Just like an invalid C# file fails the compiler.

However, maybe for known types, like the hidden file on the mac, we can skip those.

I also believe the latter was fixed with .NET 7, so I am wondering if you can confirm that it has and is working for you? Not sure we will be able to backport the fix to .NET 6 as that has a super high bar.

mattleibow avatar Feb 28 '23 18:02 mattleibow

I think this is behaviour that is mostly correct, but could be improved:

If the file is invalid, then the build should fail. Just like an invalid C# file fails the compiler.

However, maybe for known types, like the hidden file on the mac, we can skip those.

I also believe the latter was fixed with .NET 7, so I am wondering if you can confirm that it has and is working for you? Not sure we will be able to backport the fix to .NET 6 as that has a super high bar.

Hi it's a net 7 project.

//Joacim

JoacimWall avatar Feb 28 '23 19:02 JoacimWall

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

ghost avatar Mar 08 '23 01:03 ghost

It is sad that you do not prioritize this as it is very difficult to find when it happens.

Since today you already have all the code where you check if the file meets the requirements, but you have such a general error message that you don't understand what the error is.

today it's Error: One or more invalid file names were detected. File names must be lowercase, start and end with a letter character, and contain only ..

Suggestions Add the name of the file that does not meet the requirement to the error message. or Change to a warning instead of error and skip files that do not meet the requirement

//Joacim

JoacimWall avatar Mar 10 '23 08:03 JoacimWall

@JoacimWall, while i agree that this is annoying to find due to the error message, MAUI truly has some severer bugs than this so the triage has to prioritize stuff like caching bugs, keyboard bugs, ui/ux bugs on a whole bunch of platform specific problems before these nice to have improvements happen.

hej då

UkeHa avatar Mar 10 '23 08:03 UkeHa

Hi, looks like OSX creating a ".DS_Store" anywhere in resource folders breaks the build with the above error message. I can't say that I am a fan of this being regarded as "nice to have" - getting a better error message might be a simple/quick fix. Otherwise, it's yet another friction point, especially for people new to MAUI.

dom3d avatar Jun 17 '23 16:06 dom3d

@JoacimWall

Try adding Exclude = "Resources\Images\.DS_Store" to MauiImage

		<MauiImage Include="Resources\Images\*" Exclude = "Resources\Images\.DS_Store" />

And please report here if that works or not.

Investigating other workaround options.

moljac avatar Aug 11 '23 09:08 moljac

Maybe slightly better workaround:

Adding property:

		<DefaultItemExcludes>$(DefaultItemExcludes);**\.DS_Store</DefaultItemExcludes>

Then using it for ItemGroups:

		<MauiImage Include="Resources\Images\*" Exclude="$(DefaultItemExcludes)" />

@mattleibow @drasticactions @PureWeen

This workaround should be easy enough to add to template.

moljac avatar Aug 11 '23 10:08 moljac

Working samples for 2 workarounds

Archive.zip

moljac avatar Aug 11 '23 10:08 moljac

@JoacimWall @dom3d @UkeHa

Any feedback for proposed workaround?

moljac avatar Aug 14 '23 11:08 moljac

@moljac i didn't run into the problem again, but it looks sensible. It wouldn't fix my problem though. In my case it was a 0kb svg that wasn't being parsed and threw a fit instead. So as a general workaround, it's plenty enough but there should be a fallback with a better error message if the file could not be found/it fails

UkeHa avatar Aug 14 '23 11:08 UkeHa

See https://github.com/dotnet/maui/pull/16776#issuecomment-1682613863. I think this will be fixed in all .NET 8 projects per the items linked there.

Eilon avatar Aug 17 '23 16:08 Eilon

Duplicate of https://github.com/dotnet/maui/issues/14279

mattleibow avatar Nov 13 '23 23:11 mattleibow