Bug 44184 - Debug deploy always fails: ZipException: Entry has been changed
Summary: Debug deploy always fails: ZipException: Entry has been changed
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild (show other bugs)
Version: 7.0 (C8)
Hardware: PC Windows
: High critical
Target Milestone: 7.0.x (C8SR0)
Assignee: dean.ellis
URL:
: 44241 44405 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-09-12 11:46 UTC by kontakt
Modified: 2016-09-28 16:38 UTC (History)
18 users (show)

Tags:
Is this bug a regression?: Yes
Last known good build: Cycle 7 SR 1


Attachments
build output log from multiple builds with error (604.03 KB, application/zip)
2016-09-14 07:37 UTC, jcaptanis
Details
Custom libZipSharp with extra logging (90.00 KB, application/x-ms-dos-executable)
2016-09-15 09:28 UTC, dean.ellis
Details
Debug Versions of libzip.dll (32bit and 64 bit) (251.19 KB, application/zip)
2016-09-15 13:45 UTC, dean.ellis
Details
Debug Versions of LibZipSharp and libzip (289.66 KB, application/zip)
2016-09-16 10:17 UTC, dean.ellis
Details
LibZipSharp.dll (88.00 KB, application/x-ms-dos-executable)
2016-09-19 13:39 UTC, dean.ellis
Details
MSBuild buil logs for Xamarin VS 4.2.0.680 - Xamarin.Tools.Zip.ZipException: Invalid_argument (5.89 MB, text/plain)
2016-09-25 07:35 UTC, Namyslaw Szymaniuk
Details
libZipSharp.dll (91.50 KB, application/x-ms-dos-executable)
2016-09-26 09:42 UTC, dean.ellis
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description kontakt 2016-09-12 11:46:14 UTC
I updated to latest Beta (4.2.0.675) and I am not able to start the Android app with DEBUG cofiguration. Both emulator and device.

Build is successful, but deploy always fails. This is the error I get:

2>The "BuildApk" task failed unexpectedly.
2>Xamarin.Tools.Zip.ZipException: Entry has been changed
2>   at Xamarin.Tools.Zip.ZipArchive.ReadEntry(UInt64 index)
2>   at Xamarin.Tools.Zip.ZipArchive.AddFile(String sourcePath, String archivePath, EntryPermissions permissions, CompressionMethod compressionMethod, Boolean overwriteExisting)
2>   at Xamarin.Android.Tasks.BuildApk.AddAssemblies(ZipArchive apk)
2>   at Xamarin.Android.Tasks.BuildApk.ExecuteWithAbi(String supportedAbis, String apkInputPath, String apkOutputPath)
2>   at Xamarin.Android.Tasks.BuildApk.Execute()
2>   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
2>   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
Comment 1 Peter Collins 2016-09-13 02:24:33 UTC
*** Bug 44241 has been marked as a duplicate of this bug. ***
Comment 2 dean.ellis 2016-09-13 10:25:15 UTC
Any chance you can gist (gist.github.com) the full diagnostic output for this issue. Or a repo project so we can replicate it. 
It looks like a file is being added twice
Comment 3 kontakt 2016-09-13 12:25:00 UTC
Ok here's the log. Unfortunately when I set "Diagnostic" output, Visual Studio becomes "not responding", so this is a "Detailed" output. Hope it helps.
https://gist.github.com/rihadavid/d43433973eafc3e6509a6eb95a02d94e
Comment 4 dean.ellis 2016-09-13 13:43:20 UTC
You should be able to build from an MSBuild Command Prompt using the following


`msbuild MyApp.Android.csproj /t:SignAndroidPackage /v:d > build.log`

That should redirect all the diagnostic output to the build.log file.
Comment 5 kontakt 2016-09-13 16:56:02 UTC
Ok, that worked, here is the Diagnostic log: https://gist.github.com/rihadavid/8e8719419aeedf262c1a3eeb6a2ac0dd
Comment 6 Brendan Zagaeski (Xamarin Team, assistant) 2016-09-13 18:46:34 UTC
## Note to the Xamarin.Android team

To surface some important information from the duplicate, we were able to replicate this error using the test case from Bug 43968.


## Steps to replicate (from the duplicate non-public Bug 44241, Comment 0)

1. Download and unzip the repro in bug #43968
2. Restore NuGets and try to package `TIMBimbo.Droid`.
Comment 7 Brendan Zagaeski (Xamarin Team, assistant) 2016-09-14 05:57:07 UTC
## Note to the Xamarin.Android team

Shoot.  Despite trying a few different system configurations [1], I have been unable to replicate the behavior Peter was able to hit in Bug 44241, so the environment required to replicate this issue might more specific than initially hoped.

[1] For example, I noticed that both the log file from Comment 3 and the log file from Bug 44241 show a 64-bit JDK 8, so I tried that in addition to 32-bit Java JDK 7.
Comment 8 jcaptanis 2016-09-14 07:37:25 UTC
Created attachment 17455 [details]
build output log from multiple builds with error

muiltplke builds, the last debug on device failed with Zip entry error
Comment 9 jcaptanis 2016-09-14 07:38:11 UTC
As above, I am getting the same issue with the same beta. thats a lof from my build output window in diagnostic mode
Comment 10 Peter Collins 2016-09-14 17:32:35 UTC
It's definitely odd, in my testing on Windows 10 from a command prompt and within VS I was never able to nail down a consistent reproduction of this error. I was able to reproduce this initially using both C8 and C7SR1 using the test case mentioned in Comment #6. However, after re-downloading and unzipping that same test case and trying again, I was unable to reproduce anywhere (C7SR1, and multiple C8 builds).

For those able to reproduce this consistently, would it be at all possible for you to attach a project which is hitting this error? Also detailed environment information would be greatly appreciated.
Comment 11 Connor 2016-09-14 18:11:53 UTC
I am seeing this error every time. Windows 10, Java 8 update 101, JDK 8 update 101, Xamarin 4.2.0.680 c4382f5 and Xamarin.Android 7.0.0.18 0e59c36.

Using Visual Studio Community 2015 Version 14.0.25402.00 Update 3 RC.

I'll see if I can create a sample project.
Comment 12 jcaptanis 2016-09-15 00:41:38 UTC
Im seeing it everytime but cant attach sample project sorry.

Win8.1 Pro
VS2013
Java7 update 79

Couldnt someone just write us a patch that ignores the error Does it really matter if the entry is updated?  I cant repo anymore cause i spent a few hours downgrading cause this ground my dev to a halt.
Comment 13 jcaptanis 2016-09-15 00:43:08 UTC
And for me, it wasnt just debug build, it was release and making apks too - that cute new archiving screen was full of errors!
Comment 14 Namyslaw Szymaniuk 2016-09-15 06:19:12 UTC
Faced same issue, at newest *STABLE* (sic!) release of Xamarin - 4.2.0.680, at Win 10 Pro.
Tried with newest Java 8u102 x64 as well as x86, later on also with Java 7u71 x86, 7u75 x64, 7u75 x86...

Tired also to upgrade Android SDK to API24... each and every time, I was unnable to build APK, and go this issue:
The "BuildApk" task failed unexpectedly.
Xamarin.Tools.Zip.ZipException

Any news?
I spent lot of time yesterday, to downgrade Xamarin to 4.1 release. It's really annoying.

For me it's really BLOCKER.
Comment 15 Namyslaw Szymaniuk 2016-09-15 06:44:59 UTC
Forgot to mention - Visual Studio 2015 (14.0.25425.01 Update 3).

If it might help with investigating the root cause and fixing, I can spend some additional time, in order to deliver logs or anything required for reproducing the issue.

Thanks a lot for fixing it ASAP!
Comment 16 JimT 2016-09-15 07:29:24 UTC
After updating to the latest stable release (4.2.0.680) I was hitting this issue with one of my projects, but not with another. After changing options in the failing project to match those in the working project I was able to get past this problem. The settings I changed are:
In the Android project properties, under Android Options, I changed the "Use Shared Runtime" and "Use Fast Deployment" options from unchecked to checked. 

My environment is: 
 Windows 10 Version 1607
 VS 2015 Pro (Update 3)
 Xamarin 4.2.0.680
 JDK x86 1.8.0_91
 Android SDK 25.1.3
 Android NDK r11c

I hope that this information helps other users that are hitting this, and helps isolate the problem.
Comment 17 jcaptanis 2016-09-15 08:36:56 UTC
I can confirm i have 
Use ShardRuntime - Checked
Use Fast Deployment - Unchecked

but i cant confirm if swapping these would fix it because ive already downgraded.
Comment 18 dean.ellis 2016-09-15 09:28:26 UTC
Created attachment 17504 [details]
Custom libZipSharp with extra logging

We are having trouble replicating this issue on our test systems and development boxes. 
So I have added some additional logging to the LibZipSharp .dll attached to this bug. 
If someone who is experiencing this issue could use this and then send us a diagnostic build output (from the command line as per comment 4) that might help us track down this issue. 

To use the new dll do the following

1) Download it
2) Open Explorer and go to C:\Program Files (x86)\MSBuild\Xamarin\Android
3) Back up your existing libZipSharp.dll somewhere. 
4) Copy the new dll into C:\Program Files (x86)\MSBuild\Xamarin\Android
     NOTE: you will be asked for Admin permission since its a protected directory.
5) Run the build on the problematic project from the command line.


You should see extra logging such as 

DEBUG: sourcePath : obj\Release\android\typemap.mj 
DEBUG: destPath : typemap.mj 
DEBUG: Detected Regular File 
DEBUG: permissions : WorldRead, GroupWrite, GroupRead, OwnerWrite, OwnerRead
DEBUG: Attempting to Read 643

In addition the exception ToString has been modified to output some additional error codes which might help as well. 

Thanks in advance.
Comment 19 kontakt 2016-09-15 10:53:22 UTC
I can confirm that when "Use Shared Runtime" and "Use Fast Deployment" options are checked, the app deploys successfully and everything works.

BTW I sometimes get this error after clean and rebuild, instead of the ZipException - it might be related:

1>Touching "obj\Debug\_dex_stamp".
1>The "BuildApk" task failed unexpectedly.
1>System.IO.IOException: The process cannot access the file 'D:\Dokumenty-D\aplikace\MyApp\MyApp\MyApp.Android\obj\Debug\android\bin\myapp.droid.apknew' because it is being used by another process.
1>   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
1>   at System.IO.File.InternalDelete(String path, Boolean checkHost)
1>   at System.IO.File.Delete(String path)
1>   at Xamarin.Android.Tasks.BuildApk.ExecuteWithAbi(String supportedAbis, String apkInputPath, String apkOutputPath)
1>   at Xamarin.Android.Tasks.BuildApk.Execute()
1>   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

Restarting Visual Studio always solves this one, but if I don't check the "Use Shared Runtime" and "Use Fast Deployment", then there is the ZipException.
Comment 20 kontakt 2016-09-15 11:03:10 UTC
Here is the log with updated LibZipSharp.dll https://gist.github.com/rihadavid/4a8f881a7d05c319d478ab94188a2048
Comment 21 Connor 2016-09-15 13:26:43 UTC
Enabling use fast deployment allowed me to run it on a device also.
Comment 22 dean.ellis 2016-09-15 13:45:28 UTC
Created attachment 17507 [details]
Debug Versions of libzip.dll (32bit and 64 bit)

Thanks for the diagnostic output. It looks like this error is a bit lower down in libzip.dll itself. I have uploaded a zip which contains the 32bit and 64bit versions of libzip. They are in the archive as follows

libzip.dll
x64/libzip.dll

This is the same folder structure used in C:\Program Files (x86)\MSBuild\Xamarin\Android.

you should be able to extract the zip then copy the two libzip.dll files in the the correct place in the folder. the x64 one will go in C:\Program Files (x86)\MSBuild\Xamarin\Android\x64

Then run the build again and we should get a TON of additional logging which we can then sort though. But it should give us an idea of why libzip is failing on the file in question.
Comment 23 kontakt 2016-09-15 16:38:51 UTC
Ok here's the log: https://gist.github.com/rihadavid/acd0c32d531d94b0e397ef8fbb196467
Comment 24 Brendan Zagaeski (Xamarin Team, assistant) 2016-09-15 17:13:53 UTC
## Bookkeeping note to the Xamarin team

Updating the severity based on the reported behavior of the bug in the build workflow.
Comment 25 Paul Schroeder 2016-09-16 03:58:58 UTC
The following is provided just in case it helps provide others with clues or common threads to help diagnose this error.  I ran into this issue earlier today and here is my experience:

TLDR;
Following a complete system reboot I am currently unable to reproduce the problem even using what I believe was the same solution file that experienced the issue earlier.

Background:
My environment that experienced the problem is a Windows 10 VM using Visual Studio 2015 Ultimate running in Parallels connecting to a Google Android Emulator running on Mac (10.11.6 El Capitan); via SSH and Named Pipes at different points.  Prior to getting the ZipException error, the app had been debugging at various points (albeit flaky) on the Android emulator.  Worth noting, perhaps, is that this emulator image had been used prior to updating to JDK 1.8, XCode, and other Xamarin updates yesterday.

Steps I took:
	1) Had a working Android Emulator for Nexus7 image running on Mac
	2) Probably unrelated, but just noting that I had installed an Apple developer certificate in my keychain earlier today (no reboot).
	3) With some finagling, I was able to get my Windows 10 VM running using the same emulator on the Mac host - https://kb.xamarin.com/customer/portal/articles/1893620-is-it-possible-to-connect-to-android-emulators-running-on-a-mac-from-a-windows-vm
	4) On the Windows VM, I was following along with the "ENT170 Securing Local Data" sample project from Xamarin University.  I had referenced a NuGet package for Xamarin.Auth at the *solution* level and tried to have it install on all 3 projects in my solution (PCL, .ios, .android).  An error arose, "System.NotImplementedException: Portable Bait And Switch is nuget feature, so the package must be installed in all projects" error.  When I went back to check NuGet references, The Xamarin.Auth package did not seem to be installed in each individual project.  I think made sure to go through each project one-by-one and specifically reference Xamarin.Auth and the PCLCrypto NuGet packages.  
	5) I believe it was at this point I started seeing the "Xamarin ZipException The "BuildApk" task failed unexpectedly" message.  
	6) I tried switching API levels and other build options like "fast deploy" and nothing seemed to work.  I even tried deleting the emulator itself and recreating a new one - no luck.
	7) I shut down everything completely; including the VM and the Mac host
	8) Upon reboot, I went back to try and reproduce the problem.  First, I copied a "completed" ENT170 solution to the Mac host and was able to debug just fine on the emulator.  I again followed the steps outlined in the KB article from step 3 above to retest the Windows VM - the "Completed" solution debugged just fine.
	9) I opened the original solution from step 4 that was causing the error in step 5 and guess what?  It took a long time to build and deploy, but worked just fine.
	10) I created a new emulator with the same specs as the one that had now been used successfully from both the Mac and the Windows VM.  Again, it took forever to build and deploy from the Windows VM to the emulator running on the Mac host, but it did eventually work.

This was tested with these build options on the Android project:
* Use Shared Runtime, Use Fast Deployment
* Compile using Android version: Android 6.0 (Marshmallow) as well as Android 7.0 (Nougat)
* Minimum Android to target: Android 5.0 (API Level 21 - Lollipop) as well as API Level 15
* Target Android Version: Use Compile using SDK version.

Sorry I don't have more on why this happened, but the fact that the issue disappeared following a full system reboot may be relevant.  I cannot think of what else I may have done or changed to fix it.
Comment 26 dean.ellis 2016-09-16 08:45:57 UTC
*** Bug 44405 has been marked as a duplicate of this bug. ***
Comment 27 dean.ellis 2016-09-16 10:17:23 UTC
Created attachment 17534 [details]
Debug Versions of LibZipSharp and libzip

This new debug archive contains ever more diagnostic logging. We suspect that a file is being locked and as a result libzip is un able to read it. Hopefully these files will help confirm this.  The file contains

LibZipSharp.dll
libzip.dll
x64/libzip.dll

This is the same folder structure used in 
C:\Program Files (x86)\MSBuild\Xamarin\Android.

you should be able to extract the zip then copy the two libzip.dll files in the the correct place in the folder. the x64 one will go in 

C:\Program Files (x86)\MSBuild\Xamarin\Android\x64. 

Then LibZipSharp.dll goes in 

C:\Program Files (x86)\MSBuild\Xamarin\Android.

Then run the build again and we should get more additional logging which we can then sort though. 

Thanks for your assistance in looking into this issue.
Comment 28 Marcus Schmidt 2016-09-16 10:51:20 UTC
Hi,

I faced the same issue with the current stable release (Windows 10, VS 2015).
I was able to solve it by going back to Xamarin.VisualStudio_4.1.2.18.
Comment 29 kontakt 2016-09-17 12:24:28 UTC
Ok here is the log with the most recend dlls: https://gist.github.com/rihadavid/93e093faf3929bd0e89966ad3935abea
Comment 30 Namyslaw Szymaniuk 2016-09-17 17:30:26 UTC
For me, checking "Use Shared Runtime" and "Use Fast Deployment" properties, didn't solves the issue.

2>Build started.
2>The "BuildApk" task failed unexpectedly.
2>Xamarin.Tools.Zip.ZipException: Invalid argument
2>   at Xamarin.Tools.Zip.ZipArchive.AddFile(String sourcePath, String archivePath, EntryPermissions permissions, CompressionMethod compressionMethod, Boolean overwriteExisting)
2>   at Xamarin.Android.Tasks.BuildApk.ExecuteWithAbi(String supportedAbis, String apkInputPath, String apkOutputPath)
2>   at Xamarin.Android.Tasks.BuildApk.Execute()
2>   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
2>   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
2>Build FAILED.
2>An error occured. See full exception on logs for more details.
2>Build started.
2>The "BuildApk" task failed unexpectedly.
2>Xamarin.Tools.Zip.ZipException: Invalid argument
2>   at Xamarin.Tools.Zip.ZipArchive.AddFile(String sourcePath, String archivePath, EntryPermissions permissions, CompressionMethod compressionMethod, Boolean overwriteExisting)
2>   at Xamarin.Android.Tasks.BuildApk.ExecuteWithAbi(String supportedAbis, String apkInputPath, String apkOutputPath)
2>   at Xamarin.Android.Tasks.BuildApk.Execute()
2>   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
2>   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
2>Build FAILED.
Comment 31 dean.ellis 2016-09-19 10:07:58 UTC
@kontakt

Thanks for the data. The error code we are getting looks like an Access Denied error (or sharing violation) which is a bit weird.

Any chance you could install the Process Monitor from system internals [1]? This should allow you too see which process has any of the files in the obj/Debug/assets folder locked. 

I am beginning to wonder if this is anti virus related.

[1] https://technet.microsoft.com/en-us/sysinternals/bb896645
Comment 32 dean.ellis 2016-09-19 10:14:02 UTC
@Namyslaw the error you are getting is slightly different. Any chance you could gist the full diagnostic build output to gist.github.com
Comment 33 dean.ellis 2016-09-19 13:39:28 UTC
Created attachment 17586 [details]
LibZipSharp.dll

We are still unable to replicate this issue which is making is really difficult to diagnose. So I am attaching a slightly modified version of LibZipSharp which alters the AddFile method to use the Managed callback rather than the internal libzip one. 
This might either a) help fix the issue or b) provide a .net style exception which will help us track down why one of the files seems to be locked. 

If someone who is experiencing this issue could download and install this .dll in 

C:\Program Files (x86)\MSBuild\Xamarin\Android

and then provide the diagnostic output it would be really helpful.
Comment 34 Christian Muehle 2016-09-19 14:22:06 UTC
Hi,

The DLL from Dean, solved the issue on my side. I´m able to create a package again (release mode using Xamarin Studio).

Is there anything i can provide that would help?
Comment 35 kontakt 2016-09-19 14:53:34 UTC
Yes, it works for me with this DLL too. Here is my log: https://gist.github.com/rihadavid/eb56e69de3832571cf5b817fd60459b5
Comment 36 Johan Mulder 2016-09-19 15:07:10 UTC
Yes build is successful!  My project and project sample https://github.com/xamarinhq/app-evolve
is building now in release mode with latest file [attachment 17586 [details]]
Comment 37 Namyslaw Szymaniuk 2016-09-19 18:23:15 UTC
@dean.ellis@xamarin.com I'll try to upgrade Xamarin again at nearest weekend, as upgrade+downgrade tooks some time, and I'm not able to do this during working week.
Will update here ASAP with relevant logs for mine "Xamarin.Tools.Zip.ZipException: Invalid argument" issue.
Thanks
Comment 38 Sia 2016-09-19 19:17:16 UTC
@dean.ellis@xamarin.com

This issue started for me, since I can't debug on Android anymore since cycle 8 beta 8.

While looking for a solution I found this thread (https://forums.xamarin.com/discussion/45327/newest-version-of-code-not-always-deployed-when-debugging-from-xamarin-studio) which says turn off says turn off "Use Fas Deployment".

After doing this the "Xamarin.Tools.Zip.ZipException" started while deploying.

The latest libZipSharp.dll fixed this for me (had to restart VS). I can now deploy to the emulator.

I still can't debug, though, but this dll is at least fixing this bug.

Thanks!
Comment 39 jcaptanis 2016-09-20 02:18:27 UTC
@dean.ellis
I dont run any anti-virus

I do ahave another bug open https://bugzilla.xamarin.com/show_bug.cgi?id=43738
which is related to access denieds, process monitor / windows always reports its devenv.exe which has the file locked.
Comment 40 dean.ellis 2016-09-20 09:43:38 UTC
@jcaptanis did you try the updated LibZipSharp.dll attached to this bug? It probably won't solve the other issue. There were a few designer related bugs raised over the last week about it keeping files locked which they are working on, that might be related.
Comment 41 dean.ellis 2016-09-20 09:44:22 UTC
Related PR on the LibZipSharp library https://github.com/grendello/LibZipSharp/pull/20
Comment 42 jcaptanis 2016-09-21 01:40:51 UTC
@dean.ellis
got a release coming up so havnt had time to upgrade again incase it doesnt work.. Hopefully next week.
Comment 43 Brendan Zagaeski (Xamarin Team, assistant) 2016-09-22 09:39:32 UTC
## Note to the Xamarin team

I am updating the target milestone to C8SR0 to request review of the possibility of including the pull request from Comment 41 in that release because the PR is ready and the proposed change has been reported to be effective in 4 independent user verifications:

- Comment 34
- Comment 35
- Comment 36
- Comment 38

(For additional bookkeeping, I will record that there are currently 12 users CC'd on the bug report.)


Thanks!
Comment 44 Luis Aguilera 2016-09-23 12:37:37 UTC
fixed in monodroid/cycle8-sr0 commit a7189aa861716c0ce6c441d3d5b7608c98a5f87a
Comment 45 Namyslaw Szymaniuk 2016-09-25 07:35:49 UTC
Created attachment 17730 [details]
MSBuild buil logs for Xamarin VS 4.2.0.680 - Xamarin.Tools.Zip.ZipException: Invalid_argument

I'm attaching logs for mine *Xamarin.Tools.Zip.ZipException: Invalid argument* issue, mentioned here:
https://bugzilla.xamarin.com/show_bug.cgi?id=44184#c30

Logs from *MSBuild*:
   *msbuild MyApp.Android.csproj /t:SignAndroidPackage /v:d > build.log*
done at newest *lipzip* version, mentioned at this bugzilla ticket:
https://bugzilla.xamarin.com/show_bug.cgi?id=44184#c27

For newest *libzip* release is not fixing mine issue :(.
Comment 46 dean.ellis 2016-09-26 09:33:37 UTC
@Namyslaw The Invalid Argument is a different error from the one mentioned in this bug. I will take a look at the logs and see if I can figure out what is going on. 

We might need to create a new bug to handle this issue.
Comment 47 Namyslaw Szymaniuk 2016-09-26 09:36:46 UTC
Thanks a lot of your interest.
Please consider, that if any additional logs/reproducing will be needed, I can do this only during weekends, as each and every time I need to update Xamarni.VS, then uninstall, install 4.1, start Visual Studio Installer for repair option... i took some time :/

Waiting for any update. Thanks again.
Comment 48 dean.ellis 2016-09-26 09:42:41 UTC
Created attachment 17734 [details]
libZipSharp.dll

Ah looks like a bathing issue

"C:\Users\NamysˆawSzymaniuk"

So you have accented charters in that path?

If so try the latest version of the LibZipSharp.dll (see attachment) It includes a fix to handle accented paths on Windows [1]


[1] https://github.com/grendello/LibZipSharp/commit/eeba812d287c74e6d28cf5461f6fd62cff2f6963
Comment 49 Namyslaw Szymaniuk 2016-09-26 09:59:05 UTC
Yes, I have this letter - https://en.wikipedia.org/wiki/%C5%81 in my Windows User accound name - so it looks like:
*C:\Users\NamysławSzymaniuk*

I'll indeed try your latest *libZipSharp.dll* version, most probably in around 48h, if possible, and update here ASAP about the result.

Thank you very much in advance!
Comment 50 Peter Collins 2016-09-27 13:36:50 UTC
I'm going to mark this specific issue as Verified Fixed based on multiple reports from affected users (as outlined in Comment #43). If anyone on this bug thread is still encountering an issue which appears to be related to LibZipSharp (e.g. Comment #45 & #46), please open a new bug to track that behavior.
Comment 51 jcaptanis 2016-09-28 09:03:28 UTC
hey guys - i upgraded today to the latest stable and far as i can tell, the issue is fixed. Although i cant test it out on VS2013 because im hitting another bug https://bugzilla.xamarin.com/show_bug.cgi?id=44300 :| and none of the workaround are working for it. I only have a ultimate licence for 2013, so i prefer using that to my 2015 pro.

But hey, atleast with 2015 i can now deploy successfully and deploy to my samsung galaxy SM-G930F which was also fixed in this release.

I seriously love Xamarin when its working, but i f*cking hate all it when i loose hours coding chasing bugs. I have a feeling im gonna have to reinstall VS to fix my latest issue.
Comment 52 Namyslaw Szymaniuk 2016-09-28 16:38:44 UTC
@dean.ellis@xamarin.com, I wasn't able to validate your mentioned new *libZipSharp.dll* file (with UTF-8 fix inside) - https://bugzilla.xamarin.com/show_bug.cgi?id=44184#c49 at 4.2.0.680, because I tried directly newest release of Xamarin.VS 4.2.0.695, and it's just working as expected, without any issues, without any workarounds/dll replaces etc.
Thanks a lot :)!