Skip to content

Conversation

@jonathanpeppers
Copy link
Member

Fixes: dotnet/maui#1475

A .NET 6 application project was failing to include C# bindings for
.aar files, but .jar files were working.

The workaround was to include:

<LibraryProjectZip Include="myjavalibrary.aar" />

We had a test that checked this behavior for .jar files, but not
.aar files.

After reproducing the behavior in a test, I found the
_CategorizeAndroidLibraries MSBuild target did not automatically
setup the @(LibraryProjectZip) item group in .NET 6 application
projects. @(AndroidAarLibrary) was being setup, which explained
why the Java code made it to classes.dex, but C# bindings were
missing.

Updated the _CategorizeAndroidLibraries MSBuild target for this case.

Fixes: dotnet/maui#1475

A .NET 6 application project was failing to include C# bindings for
`.aar` files, but `.jar` files were working.

The workaround was to include:

    <LibraryProjectZip Include="myjavalibrary.aar" />

We had a test that checked this behavior for `.jar` files, but not
`.aar` files.

After reproducing the behavior in a test, I found the
`_CategorizeAndroidLibraries` MSBuild target did not automatically
setup the `@(LibraryProjectZip)` item group in .NET 6 application
projects. `@(AndroidAarLibrary)` *was* being setup, which explained
why the Java code made it to `classes.dex`, but C# bindings were
missing.

Updated the `_CategorizeAndroidLibraries` MSBuild target for this case.
@jonathanpeppers jonathanpeppers merged commit 52d6880 into dotnet:main Jun 29, 2021
@jonathanpeppers jonathanpeppers deleted the dotnet-aar-in-app-projects branch June 29, 2021 19:56
jonathanpeppers added a commit that referenced this pull request Jun 30, 2021
Fixes: dotnet/maui#1475

A .NET 6 application project was failing to include C# bindings for
`.aar` files, but `.jar` files were working.

The workaround was to include:

    <LibraryProjectZip Include="myjavalibrary.aar" />

We had a test that checked this behavior for `.jar` files, but not
`.aar` files.

After reproducing the behavior in a test, I found the
`_CategorizeAndroidLibraries` MSBuild target did not automatically
setup the `@(LibraryProjectZip)` item group in .NET 6 application
projects. `@(AndroidAarLibrary)` *was* being setup, which explained
why the Java code made it to `classes.dex`, but C# bindings were
missing.

Updated the `_CategorizeAndroidLibraries` MSBuild target for this case.
jonpryor pushed a commit to jonpryor/xamarin-android that referenced this pull request Aug 25, 2021
Fixes: dotnet/maui#1475

A .NET 6 application project was failing to include C# bindings for
`.aar` files, but `.jar` files were working.

The workaround was to include:

    <LibraryProjectZip Include="myjavalibrary.aar" />

We had a test that checked this behavior for `.jar` files, but not
`.aar` files.

After reproducing the behavior in a test, I found the
`_CategorizeAndroidLibraries` MSBuild target did not automatically
setup the `@(LibraryProjectZip)` item group in .NET 6 application
projects. `@(AndroidAarLibrary)` *was* being setup, which explained
why the Java code made it to `classes.dex`, but C# bindings were
missing.

Updated the `_CategorizeAndroidLibraries` MSBuild target for this case.
jonpryor pushed a commit that referenced this pull request Aug 26, 2021
Fixes: dotnet/maui#1475

A .NET 6 application project was failing to include C# bindings for
`.aar` files, but `.jar` files were working.

The workaround was to include:

    <LibraryProjectZip Include="myjavalibrary.aar" />

We had a test that checked this behavior for `.jar` files, but not
`.aar` files.

After reproducing the behavior in a test, I found the
`_CategorizeAndroidLibraries` MSBuild target did not automatically
setup the `@(LibraryProjectZip)` item group in .NET 6 application
projects. `@(AndroidAarLibrary)` *was* being setup, which explained
why the Java code made it to `classes.dex`, but C# bindings were
missing.

Updated the `_CategorizeAndroidLibraries` MSBuild target for this case.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] .AAR/.JAR Binding works on Compile but doesn't work on Runtime

2 participants