Share via

Jarsigner: unable to sign jar: java.util.zip.zipexception: attempt to write past end of STORED entry. Signing package failed.

Sreenivasan, Sreejith 780 Reputation points
2026-05-14T12:16:53.5533333+00:00

I am getting below error when distribute my .aab file.

Jarsigner: unable to sign jar: java.util.zip.zipexception: attempt to write past end of STORED entry. Signing package failed.

I am working on an MAUI project and now I upgraded the target .net framework to 10 from 8. I am facing this issue after upgraded to .net 10.

I tried deleting bin, obj folders and delete Android build cache(XamarinBuildDownloadCache and Mono for Android). Also tried Disable compression temporarily and Turn off LLVM / AOT; but nothing helps.

My current release set is adding below:

	<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net10.0-android|AnyCPU'">
	  <AndroidPackageFormat>aab</AndroidPackageFormat>
	  <AndroidLinkMode>SdkOnly</AndroidLinkMode>
	  <AndroidUseAapt2>True</AndroidUseAapt2>
	  <AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
	  <AndroidEnableAssemblyCompression>false</AndroidEnableAssemblyCompression>
	  <RunAOTCompilation>false</RunAOTCompilation>
	  <AndroidEnableLLVM>false</AndroidEnableLLVM>
	</PropertyGroup>

It was working fine with .net 8 version and under the same path I have keep the .net 10 project. So long path too long will not be a suspect for the current issue.

My VS version: Visual Studio 2026 - 18.5.2

.NET SDK Version: 10.0.203

Workload version: 10.0.203.1

User's image

Let me know if you need any additional information?

Developer technologies | .NET | .NET Multi-platform App UI
0 comments No comments

2 answers

Sort by: Most helpful
  1. Nancy Vo (WICLOUD CORPORATION) 4,190 Reputation points Microsoft External Staff Moderator
    2026-05-15T06:43:03.88+00:00

    Hello @Sreenivasan, Sreejith ,

    Thanks for your question.

    This is a known packaging/ZIP format issue introduced in .NET for Android when upgrading from .NET 8 to .NET 10. The error occurs because jarsigner encounters ZIP entries in stored mode where the declared sizes/CRCs don't strictly match what the tool expects.

    This is fundamentally a build tooling/packaging regression in the .NET 10 Android SDK — it's not caused by your project configuration.

    You can refer to following workarounds:

    1. Switch from jarsigner to apksigner.

    .NET 10 on Android now prefers apksigner over the legacy jarsigner. Add this to your csproj to force using apksigner:

    <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net10.0-android|AnyCPU'">
      <AndroidPackageFormat>aab</AndroidPackageFormat>
      <AndroidLinkMode>SdkOnly</AndroidLinkMode>
      <AndroidUseAapt2>True</AndroidUseAapt2>
      <AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
      <AndroidEnableAssemblyCompression>false</AndroidEnableAssemblyCompression>
      <RunAOTCompilation>false</RunAOTCompilation>
      <AndroidEnableLLVM>false</AndroidEnableLLVM>
      <AndroidUseApkSigner>true</AndroidUseApkSigner>
    </PropertyGroup>
    
    1. Instead of relying on VS to sign, use dotnet publish and pass signing params directly, this bypasses the problematic jarsigner path:
    dotnet publish -f:net10.0-android -c:Release \
      -p:AndroidKeyStore=true \
      -p:AndroidSigningKeyStore=your.keystore \
      -p:AndroidSigningKeyAlias=youralias \
      -p:AndroidSigningKeyPass=yourpass \
      -p:AndroidSigningStorePass=yourstorepass
    
    1. Make sure you have Android SDK Build Tools 36.0.0 (which the workload image shows is present). If not, update via Android SDK Manager. Older build tools can have ZIP alignment/signing incompatibilities.
    2. Verify workload is fully up to date.

    Run:

    dotnet workload update
    

    And verify the Android workload version is the latest 10.0.203.x. There may be a patch release that addresses this specific bug.

    Please try it and let me know if it works. I’m ready to support you if you have any further questions.

    I hope this addresses your concern. If you found it helpful, please consider sharing your feedback using the guidance .

    Was this answer helpful?


  2. Q&A Assist
    2026-05-14T12:17:08.7666667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error message indicates that the Java jarsigner tool failed while signing the Android App Bundle. In .NET for Android, errors from jarsigner are surfaced as ANDJS0000-type issues and are outside of .NET’s direct control.

    In this situation, focus on the signing step and the Java tooling rather than MAUI or MSBuild properties:

    1. Verify the signing certificate and keystore
      • Ensure the keystore file path used for signing the .aab is valid and accessible.
      • Confirm the keystore and key passwords are correct.
      • If a custom keystore is used, try creating a new keystore and configure the project to use it.
    2. Rebuild after cleaning
      • Delete the existing output (bin/obj) and perform a clean build so that the .aab is recreated before signing.
    3. Inspect the jarsigner output
      • The exact jarsigner error text is what .NET for Android reports as ANDJS0000. Use that message to adjust the signing command or configuration.
    4. If the issue persists
      • Since jarsigner errors are external to .NET for Android, consult the Java jarsigner documentation for details on the specific error and how to address it.

    References:

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.