Skip to content

Building a binding NuGet package does not include JAR files - use of the package results in java.lang.NoClassDefFoundError #10481

@brunck

Description

@brunck

Android framework version

net9.0-android

Affected platform version

VSCode 1.104.0, .NET 9.x, .NET 10.0.100-rc.1.25451.107

Description

The same problem as described in #9974 - dependent JAR files are not included in the NuGet package. AAR files are.
This is causing the same error and crash as described in the referenced issue when the binding NuGet is consumed - java.lang.NoClassDefFoundError

This happened using the .NET 9 SDK and earlier versions of VSCode so it’s not a .NET 10 regression per se.

This is a problem for package authors trying to update their packages to comply with the Google Play 16 KB requirement, which has a deadline coming.

Steps to Reproduce

Get the reproduction sample:

  1. dotnet build -c Release
  2. unzip -l ./bin/Release/com.yourcompany.SomeAndroidBinding.1.0.0.nupkg | grep kronos-java-0.0.1-alpha11.jar

Expected: The JAR file is included in the NuGet package and shown.
Actual: The JAR file is not included.

Note: running unzip -l ./bin/Release/com.yourcompany.SomeAndroidBinding.1.0.0.nupkg | grep kronos-android-0.0.1-alpha11.aar shows the AAR file as included.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIssues that need to be assigned.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions