Skip to content

AndroidLibrary Pack='false' adds .jar to NuGet package #8504

@UlyssesWu

Description

@UlyssesWu

Android application type

.NET Android (net7.0-android, etc.)

Affected platform version

VS 2022 17.8, VS 2022 17.9

Description

https://github.com/xamarin/xamarin-android/blob/main/Documentation/guides/OneDotNetBindingProjects.md

With the new OneDotNetBindingProjects, it seems that I cannot create a binding C# project for a jar, then only reference it in my main android project, but do NOT pack the jar code into the final apk.
My project XamarinPosed achieved this (also tricky) on Classic Xamarin.Android.
But for the new XamarinPosed with .NET 8, if I apply similar tricks, VS Intellisense will stop working for members in binding project, and there are CS0246 and CS0103 errors. However, the project can still be built.

image

Steps to Reproduce

  1. git clone https://github.com/UlyssesWu/XamarinPosed.Core/tree/vs_CS0246 (do not clone the main branch because it works)
  2. Open sln with VS, build the solution, it can be built without error
  3. Navigate to XamarinPosed\Loader.cs, put your mouse on IXposedHookLoadPackage, XposedBridge.Log, or just check the error list, there are CS0246 and CS0103, and there are no auto-complete. But still, the project built without error

Did you find any workaround?

Do not reference the binding project directly, but reference the built binding dll instead. Check out the main branch of my repo.

Relevant log output

No response

Metadata

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.bugComponent does not function as intended.

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions