Open jonathanpeppers opened 2 years ago
@grendello this looks very weird.
Looking at the code we are asking for the Default
compression method in CreateResourceArchive
see https://github.com/xamarin/xamarin-android/blob/fd5f31cc89648957243f31ba8fd7af7fccba11e4/src/Xamarin.Android.Build.Tasks/Utilities/ZipArchiveEx.cs#L100
Not sure why this would happen in just the IDE....
@dellis1972 from reading the code, I think it's one of the extra fields that causes the issue - the exception is thrown after this code fails, however zip_file_extra_field_set
is not documented to return the "invalid compression method" error. Unless we get ZIP_ER_INVAL
and for some reason interpret it as "invalid compression method". The exception message might be a red herring. As to why it would happen only under IDE... maybe, for some reason, VS has a different version of LibZipSharp loaded in memory that is used instead of what XA ships and XA tasks assume they're using?
this code
Its possible that its hitting a different version of LibZipSharp, but we've not bumped that for a while now I think.
TBH, the error makes no sense in the context of the code path described by the exception stack trace...
Indeed. That was confusing me as well.
The other posibility is that the wrong libzip
dll is being loaded somehow and its reporting a different code back 🤷
I'm experiencing the same issue, but in Visual Studio 2022 Professional while implementing Xamarin.Forms on Android. If you'd like, I can provide any necessary logs or similar information you may need, as this development blockage is affecting me greatly.
Another report was made here: https://developercommunity.visualstudio.com/t/MAUI-Android-project-build-fails-with-er/10471078
Android application type
Android for .NET (net6.0-android, etc.)
Affected platform version
.NET 6
Description
Originally posted by @rsfitzii at:
https://github.com/dotnet/maui/issues/6254
It appears that building an Android project in VS fails for a customer, but works with both command-line
dotnet build
or .NET Framework MSBuild...Steps to Reproduce
I'm not able to reproduce this myself. The customer builds inside Visual Studio to hit the issue.
Did you find any workaround?
No response
Relevant log output
Logs: Binlogs.zip