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

Resx file does not produce designer file, application is crashing #7504

Closed
roubachof opened this issue May 26, 2022 · 21 comments
Closed

Resx file does not produce designer file, application is crashing #7504

roubachof opened this issue May 26, 2022 · 21 comments
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer platform/android 🤖 s/needs-attention Issue has more information and needs another look s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@roubachof
Copy link

roubachof commented May 26, 2022

Description

Hello there!

I'm in the process of migration TaskLoaderView to MAUI, it was going alright till I launch the app for the first time.
It crashed right after the Splashscreen.
It was complaining about my resx file (located in Resources\Localization\SampleResources.resx), not being embedded in the resources...
After that I tried a few things, and now it seems even worst: it crashes before the splash, when loading resources assemblies:

[monodroid-assembly] open_from_bundles: failed to load assembly en-US/Retronado.Maui.resources.dll
[monodroid-assembly] open_from_bundles: failed to load assembly en-US/Retronado.Maui.resources.dll
[monodroid-assembly] open_from_bundles: failed to load assembly en/Retronado.Maui.resources.dll
[monodroid-assembly] open_from_bundles: failed to load assembly en/Retronado.Maui.resources.dll
[.retronado.mau] * Assertion: should not be reached at /__w/1/s/src/mono/mono/mini/mini-exceptions.c:456
[libc] Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 9031 (.retronado.maui), pid 9031 (.retronado.maui)

I think it is related to the resx file, cause It fails to generate the design file when building the project on Rider EAP AND on VS Mac Preview.

Steps to Reproduce

Here is the repo sample:

https://github.com/roubachof/Sharpnado.TaskLoaderView/tree/failing-resx

  • Project is Retronado.Maui
  • The resx is Resources\Localization\SampleResources.resx

Version with bug

6.0 (current)
VS for Mac preview 17.3 build 191

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 21 and up, probably iOS, since resx doesn't generate anything

Did you find any workaround?

nope

Relevant log output

No response

@roubachof roubachof added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels May 26, 2022
@Eilon Eilon added the area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer label May 26, 2022
@VincentBu
Copy link

VincentBu commented May 27, 2022

verified with with vs main (32526.500.main)
it works well on Android emulator:
image

@VincentBu VincentBu added s/verified Verified / Reproducible Issue ready for Engineering Triage and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels May 27, 2022
@roubachof
Copy link
Author

Sorry I forgot to say that the project that is crashing is:

Project is Retronado.Maui
The resx is Resources\Localization\SampleResources.resx

I edited the issue

@VincentBu
Copy link

whoops! my bad. repro on android emulator, the app also crashed on IOS emulator
image

@drasticactions
Copy link
Contributor

@roubachof Did you try moving the resx files into a different directory besides under Resources?

@drasticactions drasticactions added the s/needs-info Issue needs more info from the author label May 27, 2022
@ghost
Copy link

ghost commented May 27, 2022

Hi @roubachof. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. 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.

@roubachof
Copy link
Author

@drasticactions yes, at the beginning, the resx was in the Localization directory, directly at the project's root.

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels May 27, 2022
@drasticactions
Copy link
Contributor

drasticactions commented May 27, 2022

Have you tried making an android app without MAUI (ex. dotnet new android) and trying the same thing? does it work there?

@drasticactions drasticactions added s/needs-info Issue needs more info from the author and removed s/needs-attention Issue has more information and needs another look labels May 27, 2022
@ghost
Copy link

ghost commented May 27, 2022

Hi @roubachof. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. 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.

@pictos
Copy link
Contributor

pictos commented May 27, 2022

Maybe it's related to #1855 ?

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels May 27, 2022
@roubachof
Copy link
Author

@drasticactions the android app launches successfully in this case, with the same resx file.
But like the MAUI single project file, it fails to generate the designer file from the resx file
image

@roubachof
Copy link
Author

@PureWeen PureWeen removed the s/needs-attention Issue has more information and needs another look label Jun 28, 2022
@PureWeen PureWeen added this to the 6.0-servicing milestone Jun 28, 2022
@PureWeen
Copy link
Member

@jonathanpeppers does this ring any bells?

@jonathanpeppers
Copy link
Member

So does the app crash and/or the .resx file doesn't work at runtime on Android?

The Xamarin sample for .resx looks a bit different:

https://github.com/xamarin/xamarin-forms-samples/blob/0a9d148ef06fae1e99b8bf080c0abfbad3df746b/UsingResxLocalization/UsingResxLocalization/UsingResxLocalization/UsingResxLocalization.csproj#L42-L45

We have tests similar to this in xamarin/xamarin-android, that the built-in .resx support works ^^

If the Sharpnado sample uses:

<None Include="Localization\SampleResources.resx">
  <UseVocaDbResManager>true</UseVocaDbResManager>
  <GenerateResource>false</GenerateResource>
  <Generator>ResXFileCodeGenerator</Generator>
</None>
<!-- ... -->
<PackageReference Include="VocaDb.ResXFileCodeGenerator" Version="3.1.1">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

Does this VocaDb package just have an issue with MAUI / .NET 6 projects?

@roubachof
Copy link
Author

@jonathanpeppers :)
you are not looking at the correct branch, this is the master where I'm trying to workaround this issue.
The original branch is here: https://github.com/roubachof/Sharpnado.TaskLoaderView/tree/failing-resx

@jonathanpeppers
Copy link
Member

So the error is:

System.Resources.MissingManifestResourceException: Could not find the resource "Sample.Localization.SampleResources.resources" among the resources "Retronado.Maui.Resources.Localization.SampleResources.resources", "Retronado.Maui.App.xaml", "Retronado.Maui.MainPage.xaml", "Retronado.Maui.Platforms.Windows.App.xaml", "Retronado.Maui.Resources.Styles.Colors.xaml", "Retronado.Maui.Resources.Styles.Global.xaml", "Retronado.Maui.Resources.Styles.Icons.xaml", "Retronado.Maui.Resources.Styles.Sizes.xaml", "Retronado.Maui.Resources.Styles.StylesGameView.xaml", "Retronado.Maui.Resources.Styles.Text.xaml", ... embedded in the assembly "Retronado.Maui", nor among the resources in any satellite assemblies for the specified culture. Perhaps the resources were embedded with an incorrect name.

I see the .resources file in here with a different name:
image

The file in there matches the $(RootNamespace) of this project:

<EmbeddedResource Update="Resources\Localization\SampleResources.resx">

Are you somehow bringing in the source code for this class within this assembly?

image

I don't really understand how these projects are setup, but it looks like Samples.csproj is expecting the .resources file to be named based on its $(RootNamespace). Your app has the $(RootNamespace) of Retronado.Maui.

We have some tests in .NET 6 for .resx, so it seems like they are generally working:

https://github.com/xamarin/xamarin-android/blob/main/tests/Mono.Android-Tests/Localization/LocalizationTests.cs

@pierre01
Copy link

pierre01 commented Aug 7, 2022

I have the same issue!

@Redth Redth added the s/needs-info Issue needs more info from the author label Aug 30, 2022
@Redth Redth modified the milestones: 6.0-servicing, Backlog Aug 30, 2022
@ghost
Copy link

ghost commented Aug 30, 2022

Hi @roubachof. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. 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
Copy link

ghost commented Aug 30, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@ghost ghost added the s/no-recent-activity Issue has had no recent activity label Sep 5, 2022
@ghost
Copy link

ghost commented Sep 5, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

@pierre01
Copy link

pierre01 commented Sep 5, 2022

I have the same issue!

(This issue was fixed - for me)

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author s/no-recent-activity Issue has had no recent activity labels Sep 5, 2022
@jfversluis
Copy link
Member

I think this was fixed, if not, please let us know!

@ghost ghost locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer platform/android 🤖 s/needs-attention Issue has more information and needs another look s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests