ikvmnet / ikvm

A Java Virtual Machine and Bytecode-to-IL Converter for .NET
Other
1.24k stars 116 forks source link

C:\Users\xxx\.nuget\packages\ikvm\8.7.5\buildTransitive\IKVM.targets(98,9): error MSB4018: The "IkvmReferenceItemPrepare" task failed unexpectedly. #549

Closed mserioli closed 3 months ago

mserioli commented 3 months ago

Dear support,

since I checked out my project on a new workstation I'm getting the following error:

C:\Users\xxx.nuget\packages\ikvm\8.7.5\buildTransitive\IKVM.targets(98,9): error MSB4018: The "IkvmReferenceItemPrepare" task failed unexpectedly.

C:\Users\xxx.nuget\packages\ikvm\8.7.5\buildTransitive\IKVM.targets(98,9): error MSB4018: System.IO.InvalidDataException->Microsoft.Build.Framework.BuildException.GenericBuildTransferredException: End of Central Directory record could not be found.

I tried to clear the nuget packages folder and let VS recreate it but it dind't solved. I would say I'm stuck. Any hint?

My project is in .net 8, developed on Visual Studio 2022. I reference the nuget package:

Thanks

wasabii commented 3 months ago

That's an error about a zip file.... End of central directory....

It might be a corrupt jar?

mserioli commented 3 months ago

It was something I supposed..

I use IKVM to load:

Is there pewrhaps a jar caching directory where I can check? I'm on Windows

Many trhanks

wasabii commented 3 months ago

I do not know what you are trying to actually do, so I can't answer that.

mserioli commented 3 months ago

I was sure to have pasted it <MavenReference Include="net.sf.saxon:Saxon-HE" version="11.6" />

So I suppose Saxon jar is somewhere corrupted

wasabii commented 3 months ago

Possible. Or a dependency. Or it's not pointing to a JAR file at all. That error is about the IkvmReferenceItemPrepare task not being able to parse a JAR file to determine an assembly name or version, I believe. It tries to open the reference to find META-INF/MANIFEST.MF, to see if it has an Automatic-Module-Name attribute.

mserioli commented 3 months ago

Sincerely I'm a bit lost.

THe eror is pointing to IKWM.Targets

`

` but doens't say more. Is there a way to nealbe some loggin of what's happening? THe thing is that same project is working on another windows pc
wasabii commented 3 months ago

Could enable MSBuild binary logs and see the JAR files it is attempting to process, and then look at them.

mserioli commented 3 months ago

I see these errors that could possibly lead to the problem :

IKVM.MSBuild.Tasks.dll" in an external task host with a runtime of "CLR4" and a process architecture of "x64".

7> Task Parameter:CacheDir=C:\Users\xxx\AppData\Local\Temp\ikvm\cache\1\ 7> Launching task "IkvmReferenceItemPrepare" from assembly "C:\Users\xxx.nuget\packages\ikvm.msbuild\8.7.5\buildTransitive..\tasks\net472\IKVM.MSBuild.Tasks.dll" in an external task host with a runtime of "CLR4" and a process architecture of "x64". 7> Successfully loaded assembly info state. 7> Successfully loaded file identity state. 7> C:\Users\xxx.nuget\packages\ikvm\8.7.5\buildTransitive\IKVM.targets(98,9): error MSB4018: The "IkvmReferenceItemPrepare" task failed unexpectedly. 7> C:\Users\xxx.nuget\packages\ikvm\8.7.5\buildTransitive\IKVM.targets(98,9): error MSB4018: System.IO.InvalidDataException->Microsoft.Build.Framework.BuildException.GenericBuildTransferredException: End of Central Directory record could not be found. 7> Done executing task "IkvmReferenceItemPrepare" -- FAILED.

wasabii commented 3 months ago

Can you try enabling the MSBuild binary logger, increasing MSBuild logging verbosity to detailed, and seeing the JAR files that are actually being processed?

mserioli commented 3 months ago

Thank you man.

image

It pointed me out C:\Users\xxx.m2\repository

which contained corrupted jar files :(

Removed them, rebuilt, and now it works,

Thanks again!

wasabii commented 3 months ago

Np