Open UlyssesWu opened 11 months ago
@jonathanpeppers Is there a way to do the equivalent of @(InputJar)
using <ProjectReference>
?
If I do <AndroidLibrary Include="auto-value-annotations-1.10.4.jar" Pack="false" />
in a binding project, and then reference that project in my app project using <ProjectReference>
, the .jar
appears to be picked up and compiled into the app:
This would probably work:
<None Remove="auto-value-annotations-1.10.4.jar" />
I remember thinking that @(InputJar)
was somewhat useless, and so we don't have an easy replacement. We could maybe make it respect %(CopyToOutputDirectory)
.
I think an issue is that it's not explicitly %(CopyToOutputDirectory)
, the .jar
gets placed in a <project_name>.aar
in the output dir:
Maybe we just need to prevent it from ending up in there?
Hmm, I guess Pack=false
doesn't work for NuGet either, it also includes the binding.aar
file containing the .jar
:
Does the default wildcard pick this up, so you'd need to do Update
?
<AndroidLibrary Update="auto-value-annotations-1.10.4.jar" Pack="false" />
My test uses <EnableDefaultItems>false</EnableDefaultItems>
to avoid this issue.
It seems one of the issues is this loop should probably continue;
if %(Pack)
is false:
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 areCS0246
andCS0103
errors. However, the project can still be built.Steps to Reproduce
XamarinPosed\Loader.cs
, put your mouse onIXposedHookLoadPackage
,XposedBridge.Log
, or just check the error list, there areCS0246
andCS0103
, and there are no auto-complete. But still, the project built without errorDid 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