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

Unable to build in Release #13676

Closed
Woetroer opened this issue Mar 3, 2023 · 19 comments
Closed

Unable to build in Release #13676

Woetroer opened this issue Mar 3, 2023 · 19 comments
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) area-setup Installation, setup, requirements, maui-check, workloads, platform support platform/android 🤖 platform/windows 🪟 s/needs-attention Issue has more information and needs another look t/bug Something isn't working

Comments

@Woetroer
Copy link

Woetroer commented Mar 3, 2023

Description

When I try to build my application in Release mode I get the errors "Optimizing assemblies for size failed" and "Failed to write" see this screenshot.

I have tried setting publish trimmed to false as suggested by the error without success.

Steps to Reproduce

  1. Open the project from the referenced reproduction repository.
  2. Build in release

Link to public reproduction project repository

https://github.com/Woetroer/ToDo/tree/master

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, Windows, I was not able test on other platforms

Affected platform versions

Android 12

Did you find any workaround?

No response

Relevant log output

No response

@Woetroer Woetroer added the t/bug Something isn't working label Mar 3, 2023
@Woetroer Woetroer changed the title Can't build in Release Unable to build in Release Mar 3, 2023
@jsuarezruiz jsuarezruiz added the area-setup Installation, setup, requirements, maui-check, workloads, platform support label Mar 3, 2023
@rachelkang rachelkang added the area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) label Mar 6, 2023
@rachelkang
Copy link
Member

Hi, @Woetroer - would you be able to share the full error logs? I unfortunately am not seeing the screenshot you mention. Thanks!

@rachelkang rachelkang added the s/needs-info Issue needs more info from the author label Mar 6, 2023
@ghost
Copy link

ghost commented Mar 6, 2023

Hi @Woetroer. 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.

@Woetroer
Copy link
Author

Woetroer commented Mar 7, 2023

Hi, @Woetroer - would you be able to share the full error logs? I unfortunately am not seeing the screenshot you mention. Thanks!

Hi Rachel, I have attached the screenshot.

@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 Mar 7, 2023
@PureWeen
Copy link
Member

PureWeen commented Mar 7, 2023

@jonathanpeppers thoughts?

In the meantime @Woetroer can you attach a binlog? https://github.com/xamarin/xamarin-macios/wiki/Diagnosis

@PureWeen PureWeen 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 Mar 7, 2023
@ghost
Copy link

ghost commented Mar 7, 2023

Hi @Woetroer. 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.

@jonathanpeppers
Copy link
Member

Yes, a .binlog would show the actual underlying error from ILLink. I don't think we have enough information on a screenshot.

@Woetroer
Copy link
Author

Woetroer commented Mar 8, 2023

@PureWeen @jonathanpeppers I have now attached the zip file with the binlog to the repository

@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 Mar 8, 2023
@jonathanpeppers
Copy link
Member

Is it the correct log? It has no errors inside:

image

You can open these files with the tool at https://msbuildlog.com to view them.

@jonathanpeppers jonathanpeppers 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 Mar 8, 2023
@ghost
Copy link

ghost commented Mar 8, 2023

Hi @Woetroer. 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.

@Woetroer
Copy link
Author

Woetroer commented Mar 9, 2023

@jonathanpeppers Yes I used the tool to build the project and generate the log file. After that I zipped it and sent it here.

This is what I see
2023-03-09 09_42_35-C__Users_Woetroe_source_ItvitaeRepos_ToDoApp_msbuild binlog - MSBuild Structured

@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 Mar 9, 2023
@jonathanpeppers
Copy link
Member

@Woetroer in your log the build succeeded. If it was a failure, the log view automatically searches $error (with a dollar sign) and shows the error message. There are no errors in here?

Do you need to try again and do a Release build? -c Release

@jonathanpeppers jonathanpeppers added s/needs-attention Issue has more information and needs another look s/needs-info Issue needs more info from the author and removed s/needs-attention Issue has more information and needs another look labels Mar 9, 2023
@ghost
Copy link

ghost commented Mar 9, 2023

Hi @Woetroer. 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.

@Woetroer
Copy link
Author

@jonathanpeppers I tried Command line arguments = "C:\Program Files\dotnet\sdk\7.0.201\MSBuild.dll C:\Users\Woetroe\source\ItvitaeRepos\ToDoApp\ToDoApp.sln /property:Configuration=Release /v:diag /nologo /clp:NoSummary;Verbosity=minimal /bl" this as the cli argument. The build succeeded and gave no $errors again.

@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 Mar 13, 2023
@jonathanpeppers
Copy link
Member

We need a .binlog with the details about "Optimizing assemblies for size failed" inside.

Did the problem mysteriously go away?

@Woetroer
Copy link
Author

We need a .binlog with the details about "Optimizing assemblies for size failed" inside.

Did the problem mysteriously go away?

No it still gives me the errors when I build in visual studio. I can't seem to build it in release using the ms build log viewer.

@jonathanpeppers
Copy link
Member

You don't actually have to build it with the .binlog viewer, but you can just add -bl to any dotnet build or msbuild command.

If you want to try inside VS you can use:

https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProjectSystemTools2022

Just make sure you have this enabled:

image

View > Other Windows > Build Logging can record .binlog files.

Find one that contains your error. Thanks!

@jonathanpeppers jonathanpeppers 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 Mar 14, 2023
@ghost
Copy link

ghost commented Mar 14, 2023

Hi @Woetroer. 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.

@Woetroer
Copy link
Author

@jonathanpeppers After installing project tools and setting the setting to diagnostic I ran the build in release. It finished with no errors. I think the errors somehow went away. If the errors return I will provide the build log but it works for now. Thanks.

@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 Mar 14, 2023
@jonathanpeppers
Copy link
Member

Let us know and we can reopen, thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) area-setup Installation, setup, requirements, maui-check, workloads, platform support platform/android 🤖 platform/windows 🪟 s/needs-attention Issue has more information and needs another look t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants