maui
maui copied to clipboard
Unable to build in Release
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
- Open the project from the referenced reproduction repository.
- 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
Hi, @Woetroer - would you be able to share the full error logs? I unfortunately am not seeing the screenshot you mention. Thanks!
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.
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.
@jonathanpeppers thoughts?
In the meantime @Woetroer can you attach a binlog? https://github.com/xamarin/xamarin-macios/wiki/Diagnosis
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.
Yes, a .binlog
would show the actual underlying error from ILLink
. I don't think we have enough information on a screenshot.
@PureWeen @jonathanpeppers I have now attached the zip file with the binlog to the repository
Is it the correct log? It has no errors inside:
You can open these files with the tool at https://msbuildlog.com to view them.
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 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
@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
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 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.
We need a .binlog
with the details about "Optimizing assemblies for size failed"
inside.
Did the problem mysteriously go away?
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.
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:
View > Other Windows > Build Logging
can record .binlog
files.
Find one that contains your error. Thanks!
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 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.
Let us know and we can reopen, thanks!